Also, I loaded up my sketch that tests for the Zero Cross pulse today (had not run it for awhile). It performed as expected. For this sketch you need to load throough the USB port and also monitor through that same port. I have it set up for 115200 baud. If you are not getting anything in the serial monitor then I think you have a problem with your Zero Cross circuit.
kev wrote:Also, I loaded up my sketch that tests for the Zero Cross pulse today (had not run it for awhile). It performed as expected. For this sketch you need to load throough the USB port and also monitor through that same port. I have it set up for 115200 baud. If you are not getting anything in the serial monitor then I think you have a problem with your Zero Cross circuit.
your ZCD code works... what i have done right now is removed the ZCD circuit and i am creating an interrupt by touching the wire connected to pin 2. the serial monitor shows a result (mind you it will not show the right frequency but I can verify that the interrupt is being triggered :))
kev wrote:First of all, I am not a programmer, but I did sleep in a Holiday Inn last night! I know enough to be dangerous!When you say "so I checked code 2 with vixen 3 and it works!" what exactly does "it works" mean?
As far as adding code to cause random in between songs or when Vixen is off, I don't know how to incorporateit into this existing sketch. As LightUp said, Vixen 3 always sends data whether playing a song or not. It is sendimg all 0's. If you are wantimg random lights in between songs, you could devise a sequence that appears random and just add it to the playlist wherever you wanted random lights.
If the outputs are ON when they should be OFF, you could comment out the following line of code. That line is towards the bottom of the sketch.
// channelValue[index++]= map(inByte,0,255,255,0); // save the channel value, reverse it 0-255 becomes 255-0To define your channels so that it is more easy to read/understand, you could do something like the following (if I got your numbers correct).
#define CHANNEL_PIN_1 22 #define CHANNEL_PIN_2 24 #define CHANNEL_PIN_3 26 #define CHANNEL_PIN_4 28 #define CHANNEL_PIN_5 30 #define CHANNEL_PIN_6 32 #define CHANNEL_PIN_7 34 #define CHANNEL_PIN_8 36 #define CHANNEL_PIN_9 23 #define CHANNEL_PIN_10 25 #define CHANNEL_PIN_11 27 #define CHANNEL_PIN_12 29 #define CHANNEL_PIN_13 31 #define CHANNEL_PIN_14 33 #define CHANNEL_PIN_15 35 #define CHANNEL_PIN_16 37 #define CHANNEL_PIN_17 38 #define CHANNEL_PIN_18 40 #define CHANNEL_PIN_19 42 #define CHANNEL_PIN_20 44 #define CHANNEL_PIN_21 46 #define CHANNEL_PIN_22 48 #define CHANNEL_PIN_23 50 #define CHANNEL_PIN_24 52 #define CHANNEL_PIN_25 39 #define CHANNEL_PIN_26 41 #define CHANNEL_PIN_27 43 #define CHANNEL_PIN_28 45 #define CHANNEL_PIN_29 47 #define CHANNEL_PIN_30 49 #define CHANNEL_PIN_31 51 #define CHANNEL_PIN_32 53
I am going to try using this and see if the channel allocation works properly.... i cant see anywhere else why the code as it stands shouldnt change the allocation to the pins if i change the Start + ** numbers....
"... what i have done right now is removed the ZCD circuit and i am creating an interrupt by touching the wire connected to pin 2."
Well then, you need to get a working Zero Cross. Can you take a picture of the back of your ZC circuit board? Tjere may be something a new set of eyes can pick out.
Have you verified that you are getting the right AC & DC voltages on your zcd board?
kev wrote:First of all, I am not a programmer, but I did sleep in a Holiday Inn last night! I know enough to be dangerous!When you say "so I checked code 2 with vixen 3 and it works!" what exactly does "it works" mean?
As far as adding code to cause random in between songs or when Vixen is off, I don't know how to incorporateit into this existing sketch. As LightUp said, Vixen 3 always sends data whether playing a song or not. It is sendimg all 0's. If you are wantimg random lights in between songs, you could devise a sequence that appears random and just add it to the playlist wherever you wanted random lights.
If the outputs are ON when they should be OFF, you could comment out the following line of code. That line is towards the bottom of the sketch.
// channelValue[index++]= map(inByte,0,255,255,0); // save the channel value, reverse it 0-255 becomes 255-0To define your channels so that it is more easy to read/understand, you could do something like the following (if I got your numbers correct).
#define CHANNEL_PIN_1 22 #define CHANNEL_PIN_2 24 #define CHANNEL_PIN_3 26 #define CHANNEL_PIN_4 28 #define CHANNEL_PIN_5 30 #define CHANNEL_PIN_6 32 #define CHANNEL_PIN_7 34 #define CHANNEL_PIN_8 36 #define CHANNEL_PIN_9 23 #define CHANNEL_PIN_10 25 #define CHANNEL_PIN_11 27 #define CHANNEL_PIN_12 29 #define CHANNEL_PIN_13 31 #define CHANNEL_PIN_14 33 #define CHANNEL_PIN_15 35 #define CHANNEL_PIN_16 37 #define CHANNEL_PIN_17 38 #define CHANNEL_PIN_18 40 #define CHANNEL_PIN_19 42 #define CHANNEL_PIN_20 44 #define CHANNEL_PIN_21 46 #define CHANNEL_PIN_22 48 #define CHANNEL_PIN_23 50 #define CHANNEL_PIN_24 52 #define CHANNEL_PIN_25 39 #define CHANNEL_PIN_26 41 #define CHANNEL_PIN_27 43 #define CHANNEL_PIN_28 45 #define CHANNEL_PIN_29 47 #define CHANNEL_PIN_30 49 #define CHANNEL_PIN_31 51 #define CHANNEL_PIN_32 53
Hi Kevin,
i tried this and it still doesnt fix the order of channel outputs. In fact i can change the output numbers to anything and it still does the power on self test jumping from 1 - 9, 2 - 10, 3 - 11 so on so forth...
I have 110V across the inputs (pin 1 and 2 of the H11AA1). ZCD output is at 2.7 volts... which doesnt seem right.
I dont have access to an oscilloscope... is there any other way to verify this? i have gone through 3 H11AA1 chips so far...
LightUp wrote:Have you verified that you are getting the right AC & DC voltages on your zcd board?
I have 110V across the inputs (pin 1 and 2 of the H11AA1). ZCD output is at 2.7 volts... which doesnt seem right.
I dont have access to an oscilloscope... is there any other way to verify this? i have gone through 3 H11AA1 chips so far...
kev wrote:"... what i have done right now is removed the ZCD circuit and i am creating an interrupt by touching the wire connected to pin 2."Well then, you need to get a working Zero Cross. Can you take a picture of the back of your ZC circuit board? Tjere may be something a new set of eyes can pick out.
here you go...
-The only thing I see on the back of the ZC circuit is, maybe, a poor solder joint where the 10K pullup resistor is soldered to the +5V terminal.
- I assume that the 3 position terminal where you bring GND, +5v in and the ZERO Cross out, the ZERO CROSS out is the middle terminal.
- In the overall system picture, from where I can zoom in, it looks like you have a twisted pair of wires going from the ZERO CROSS terminal to two pins on the MEGA shield. I can't quite make it out. Is one of those wires a GND reference for the MEGA? Or is it just one wire with a color stripe that makes it look like two wires.
- Do you have the DC GNDs for all of the DC components all tied together?
- 2.7V on the ZERO CROSS output makes sense if the pulse is wide enough and depending on your meter characteristics.

