Hi, I have an 8 Channel Vixen 3 light show. When the song is over I do not want it just to be off. I want it to be all on when nothing is playing. I do not want a dark house when my sequence is not playing. Here is the code which works perfect made by Jetty:
#define UNO_VIXEN
#ifdef UNO_VIXEN
#define MAX_CHANNELS 8
int channels[MAX_CHANNELS] = {5,6,7,8,9,10,11,12};
#endif
int incomingByte[MAX_CHANNELS];
void setup()
{
int i;
Serial.begin(9600); // set up Serial at 9600 bps
for ( i = 0; i < MAX_CHANNELS; i ++ ) pinMode(channels[i], OUTPUT);
}
void loop()
{
int i;
if (Serial.available() >= MAX_CHANNELS)
{
for (i=0; i < MAX_CHANNELS; i ++) incomingByte[i] = Serial.read();
}
for (i = 0; i < MAX_CHANNELS; i ++ ) analogWrite(channels[i], incomingByte[i]);
}
I have an idea of how to do this but I don't know how to code it. It would be greatly appreciated if I got the code to do this:
Create two variables, one to count when a channel is non-zero, and one to set the time to millisec timer. If the count of all channels is zero and stays like that for say a second or two, assume that the sequence has ended and switch all lights ON.
Thanks.