OK guys going for upgrades this year and went out and got a Mega 2560. I have the three sets of 8 ssr working but the 4th set is not working. Here's the code I have inputed. This is just for on and off.
// Output
int Chan1 = 2; // LED, connected to digital pin 2
int Chan2 = 3; // LED, connected to digital pin 3
int Chan3 = 4; // LED, connected to digital pin 4
int Chan4 = 5; // LED, connected to digital pin 5
int Chan5 = 6; // LED, connected to digital pin 6
int Chan6 = 7; // LED, connected to digital pin 7
int Chan7 = 8; // LED, connected to digital pin 8
int Chan8 = 9; // LED, connected to digital pin 9
int Chan9 = 10; // LED, connected to digital pin 10
int Chan10 = 11; // LED, connected to digital pin 11
int Chan11 = 12; // LED, connected to digital pin 12
int Chan12 = 22; // LED, connected to digital pin 22
int Chan13 = 23; // LED, connected to digital pin 23
int Chan14 = 24; // LED, connected to digital pin 24
int Chan15 = 25; // LED, connected to digital pin 25
int Chan16 = 26; // LED, connected to digital pin 26
int Chan17 = 27; // LED, connected to digital pin 27
int Chan18 = 28; // LED, connected to digital pin 28
int Chan19 = 29; // LED, connected to digital pin 29
int Chan20 = 30; // LED, connected to digital pin 30
int Chan21 = 31; // LED, connected to digital pin 31
int Chan22 = 32; // LED, connected to digital pin 32
int Chan23 = 33; // LED, connected to digital pin 33
int Chan24 = 34; // LED, connected to digital pin 34
int Chan25 = 35; // LED, connected to digital pin 35
int Chan26 = 36; // LED, connected to digital pin 36
int Chan27 = 37; // LED, connected to digital pin 37
int Chan28 = 38; // LED, connected to digital pin 38
int Chan29 = 39; // LED, connected to digital pin 39
int Chan30 = 40; // LED, connected to digital pin 40
int Chan31 = 41; // LED, connected to digital pin 42
int Chan32 = 42; // LED, connected to digital pin 43
int i = 0; // Loop counter
int incomingByte[52]; // array to store the 7 values from the serial port
//setup the pins/ inputs & outputs
void setup()
{
Serial.begin(9600); // set up Serial at 9600 bps
pinMode(Chan1, OUTPUT); // sets the pins as output
pinMode(Chan2, OUTPUT);
pinMode(Chan3, OUTPUT);
pinMode(Chan4, OUTPUT);
pinMode(Chan5, OUTPUT);
pinMode(Chan6, OUTPUT); // sets the pins as output
pinMode(Chan7, OUTPUT);
pinMode(Chan8, OUTPUT);
pinMode(Chan9, OUTPUT);
pinMode(Chan10, OUTPUT);
pinMode(Chan11, OUTPUT);
pinMode(Chan12, OUTPUT);
pinMode(Chan13, OUTPUT);
pinMode(Chan14, OUTPUT);
pinMode(Chan15, OUTPUT);
pinMode(Chan16, OUTPUT);
pinMode(Chan17, OUTPUT); // sets the pins as output
pinMode(Chan18, OUTPUT);
pinMode(Chan19, OUTPUT);
pinMode(Chan20, OUTPUT);
pinMode(Chan21, OUTPUT);
pinMode(Chan22, OUTPUT); // sets the pins as output
pinMode(Chan23, OUTPUT);
pinMode(Chan24, OUTPUT);
pinMode(Chan25, OUTPUT);
pinMode(Chan26, OUTPUT);
pinMode(Chan27, OUTPUT);
pinMode(Chan28, OUTPUT);
pinMode(Chan29, OUTPUT);
pinMode(Chan30, OUTPUT);
pinMode(Chan31, OUTPUT);
pinMode(Chan32, OUTPUT);
}
void loop()
{ // 7 channels are coming in to the Arduino
if (Serial.available() >= 52) {
// read the oldest byte in the serial buffer:
for (int i = 0; i < 52; i++) {
// read each byte
incomingByte = Serial.read();
}
digitalWrite(Chan1, incomingByte[0]); // Write current values to LED pins
digitalWrite(Chan2, incomingByte[1]); // Write current values to LED pins
digitalWrite(Chan3, incomingByte[2]); // Write current values to LED pins
digitalWrite(Chan4, incomingByte[3]); // Write current values to LED pins
digitalWrite(Chan5, incomingByte[4]); // Write current values to LED pins
digitalWrite(Chan6, incomingByte[5]); // Write current values to LED pins
digitalWrite(Chan7, incomingByte[6]); // Write current values to LED pins
digitalWrite(Chan8, incomingByte[7]); // Write current values to LED pins
digitalWrite(Chan9, incomingByte[8]); // Write current values to LED pins
digitalWrite(Chan10, incomingByte[9]); // Write current values to LED pins
digitalWrite(Chan11, incomingByte[10]); // Write current values to LED pins
digitalWrite(Chan12, incomingByte[11]); // Write current values to LED pins
digitalWrite(Chan13, incomingByte[12]); // Write current values to LED pins
digitalWrite(Chan14, incomingByte[13]); // Write current values to LED pins
digitalWrite(Chan15, incomingByte[14]); // Write current values to LED pins
digitalWrite(Chan16, incomingByte[15]); // Write current values to LED pins
digitalWrite(Chan17, incomingByte[16]); // Write current values to LED pins
digitalWrite(Chan18, incomingByte[17]); // Write current values to LED pins
digitalWrite(Chan19, incomingByte[18]); // Write current values to LED pins
digitalWrite(Chan20, incomingByte[19]); // Write current values to LED pins
digitalWrite(Chan21, incomingByte[20]); // Write current values to LED pins
digitalWrite(Chan22, incomingByte[21]); // Write current values to LED pins
digitalWrite(Chan23, incomingByte[22]); // Write current values to LED pins
digitalWrite(Chan24, incomingByte[23]); // Write current values to LED pins
digitalWrite(Chan25, incomingByte[24]); // Write current values to LED pins
digitalWrite(Chan26, incomingByte[25]); // Write current values to LED pins
digitalWrite(Chan27, incomingByte[26]); // Write current values to LED pins
digitalWrite(Chan28, incomingByte[27]); // Write current values to LED pins
digitalWrite(Chan29, incomingByte[28]); // Write current values to LED pins
digitalWrite(Chan30, incomingByte[29]); // Write current values to LED pins
digitalWrite(Chan31, incomingByte[30]); // Write current values to LED pins
digitalWrite(Chan32, incomingByte[31]); // Write current values to LED pins
}
}
Here is a video a just took of the 3 of 4 working.
As I understand it you have 32 channels, based on 4 boards of 8 SSRs per board.
But in your code you read 52 channels of data.
Does Vixen send 32 channels of data or 52?
There is nothing in your code to account for the 20 extra channels. Are you perhaps overwriting the 32 channels and the last 8 SSRs end up with zeros, or off?
Does the 4th board have dc power applied to make it work? I can't verify your wiring from your video.
Fixed the code, then jingled around one of the boards, bingo!! The forth board had a VCC lose so I tacked alittle solder on it now it's good to go. Thanks !!
