This is how many get started without knowing the pitfalls. In their excitement they can overlook some issues they don't understand, but are willing to give it a go. Very few seem to research it to any real depth before they make the plunge. But, we are here to help, right?
So the consensus here is that the victor sketch is better and will still work for me?
Some years ago, many new to the lighting scene, had issues with serial ports, baudrate, channel counts, inverted logic, and Vixen interface problems. We saw repeat beginner problems and many had different sketches they found on the web that they wanted us to modify for them. It was thought that most problems would resolve themselves if all the beginners would start with the same sketch. Victor took it upon himself to do that so most could get started with a sketch that included all the basic items needed for these various relay and SSR products in one sketch. This minimized us having to constantly modify sketches to suit various needs. It was not designed for pixels. Yet some wanted both relays and pixels with one Arduino and so there are a few sketches here that do that, but it was not done by victor.
If you use Vixen, relays and zero-cross SSRs then victor's sketch will work for you.
yeah thanks, Victors did not work for mine at all. I went back to the original i had and now it seems to work the way it should, no issues. so there must have been something i had copied wrong, anyway it works perfect now, i just wanted basic functions of on and off and maybe some dimming all works.
here is the working code:
#define MEGA_VIXEN
//#define UNO_VIXEN
#ifdef MEGA_VIXEN
#define MAX_CHANNELS 48
int channels[MAX_CHANNELS] = {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,22,23,24, 25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41 ,42,43,44,45,46,47,48,49,50,51,52,53};
#endif
#ifdef UNO_VIXEN
#define MAX_CHANNELS 18
int channels[MAX_CHANNELS] = {2,3,4,5,6,7,8,9,10,11,12,13,A0,A1,A2,A3,A4,A5};
#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]);
}
so far it works....
Bookmarks