I am trying to use an arduino to take incoming data from vixen software through serial comm. and move the data to 12 other arduino it works if I keep the channel numbers from the vixen to 43 but I need to control 480 channels. so the first arduino controls 43 channels the next is 44-87 and so on.
this is my master code: `void setup() { Serial.begin(9600);
Serial3.begin(9600);
}
void loop()
{
// read from port 0, send to port 1:
if (Serial.available()) {
int inByte = Serial.read();
Serial3.write(inByte);
}
}
this is the slave code:
// Output
int cue1 = 3;
int cue2 = 4;
int cue3 = 5;
int cue4 = 6;
int cue5 = 7;
int cue6 = 8;
int cue7 = 9;
int cue8 = 10;
int cue9 = 11;
int cue10 = 12;
int cue11 = 13;
int cue12 = 22;
int cue13 = 23;
int cue14 = 24;
int cue15 = 25;
int cue16 = 26;
int cue17 = 27;
int cue18 = 28;
int cue19 = 29;
int cue20 = 30;
int cue21 = 31;
int cue22 = 32;
int cue23 = 33;
int cue24 = 34;
int cue25 = 35;
int cue26 = 36;
int cue27 = 37;
int cue28 = 38;
int cue29 = 39;
int cue30 = 40;
int cue31 = 41;
int cue32 = 42;
int cue33 = 43;
int cue34 = 44;
int cue35 = 45;
int cue36 = 46;
int cue37 = 47;
int cue38 = 48;
int cue39 = 49;
int cue40 = 50;
int cue41 = 51;
int cue42 = 52;
int cue43 = 53;
int i = 0;
int incomingByte[43];
void setup() // run once, when the sketch starts
{
Serial3.begin(9600);
pinMode(cue1, OUTPUT); // sets the digital pin as output
pinMode(cue2, OUTPUT); // sets the digital pin as output
pinMode(cue3, OUTPUT); // sets the digital pin as output
pinMode(cue4, OUTPUT); // sets the digital pin as output
pinMode(cue5, OUTPUT); // sets the digital pin as output
pinMode(cue5, OUTPUT); // sets the digital pin as output
pinMode(cue6, OUTPUT); // sets the digital pin as output
pinMode(cue7, OUTPUT); // sets the digital pin as output
pinMode(cue8, OUTPUT); // sets the digital pin as output
pinMode(cue9, OUTPUT); // sets the digital pin as output
pinMode(cue10, OUTPUT); // sets the digital pin as output
pinMode(cue11, OUTPUT); // sets the digital pin as output
pinMode(cue12, OUTPUT); // sets the digital pin as output
pinMode(cue13, OUTPUT); // sets the digital pin as output
pinMode(cue14, OUTPUT); // sets the digital pin as output
pinMode(cue15, OUTPUT); // sets the digital pin as output
pinMode(cue16, OUTPUT); // sets the digital pin as output
pinMode(cue17, OUTPUT); // sets the digital pin as output
pinMode(cue18, OUTPUT); // sets the digital pin as output
pinMode(cue19, OUTPUT); // sets the digital pin as output
pinMode(cue20, OUTPUT); // sets the digital pin as output
pinMode(cue21, OUTPUT); // sets the digital pin as output
pinMode(cue22, OUTPUT); // sets the digital pin as output
pinMode(cue23, OUTPUT); // sets the digital pin as output
pinMode(cue24, OUTPUT); // sets the digital pin as output
pinMode(cue25, OUTPUT); // sets the digital pin as output
pinMode(cue26, OUTPUT); // sets the digital pin as output
pinMode(cue27, OUTPUT); // sets the digital pin as output
pinMode(cue28, OUTPUT); // sets the digital pin as output
pinMode(cue29, OUTPUT); // sets the digital pin as output
pinMode(cue30, OUTPUT); // sets the digital pin as output
pinMode(cue31, OUTPUT); // sets the digital pin as output
pinMode(cue32, OUTPUT); // sets the digital pin as output
pinMode(cue33, OUTPUT); // sets the digital pin as output
pinMode(cue34, OUTPUT); // sets the digital pin as output
pinMode(cue35, OUTPUT); // sets the digital pin as output
pinMode(cue36, OUTPUT); // sets the digital pin as output
pinMode(cue37, OUTPUT); // sets the digital pin as output
pinMode(cue38, OUTPUT); // sets the digital pin as output
pinMode(cue39, OUTPUT); // sets the digital pin as output
pinMode(cue40, OUTPUT); // sets the digital pin as output
pinMode(cue41, OUTPUT); // sets the digital pin as output
pinMode(cue42, OUTPUT); // sets the digital pin as output
pinMode(cue43, OUTPUT); // sets the digital pin as output
}
void loop()
{
if (Serial3.available() >=43)
{
for (int i=0; i<43;i++)
{
incomingByte[i] = Serial3.read();
}
digitalWrite(cue1, incomingByte[0]);
digitalWrite(cue2, incomingByte[1]);
digitalWrite(cue3, incomingByte[2]);
digitalWrite(cue4, incomingByte[3]);
digitalWrite(cue5, incomingByte[4]);
digitalWrite(cue6, incomingByte[5]);
digitalWrite(cue7, incomingByte[6]);
digitalWrite(cue8, incomingByte[7]);
digitalWrite(cue9, incomingByte[8]);
digitalWrite(cue10, incomingByte[9]);
digitalWrite(cue11, incomingByte[10]);
digitalWrite(cue12, incomingByte[11]);
digitalWrite(cue13, incomingByte[12]);
digitalWrite(cue14, incomingByte[13]);
digitalWrite(cue15, incomingByte[14]);
digitalWrite(cue16, incomingByte[15]);
digitalWrite(cue17, incomingByte[16]);
digitalWrite(cue18, incomingByte[17]);
digitalWrite(cue19, incomingByte[18]);
digitalWrite(cue20, incomingByte[19]);
digitalWrite(cue21, incomingByte[20]);
digitalWrite(cue22, incomingByte[21]);
digitalWrite(cue23, incomingByte[22]);
digitalWrite(cue24, incomingByte[23]);
digitalWrite(cue25, incomingByte[24]);
digitalWrite(cue26, incomingByte[25]);
digitalWrite(cue27, incomingByte[26]);
digitalWrite(cue28, incomingByte[27]);
digitalWrite(cue29, incomingByte[28]);
digitalWrite(cue30, incomingByte[29]);
digitalWrite(cue31, incomingByte[30]);
digitalWrite(cue32, incomingByte[31]);
digitalWrite(cue33, incomingByte[32]);
digitalWrite(cue34, incomingByte[33]);
digitalWrite(cue35, incomingByte[34]);
digitalWrite(cue36, incomingByte[35]);
digitalWrite(cue37, incomingByte[36]);
digitalWrite(cue38, incomingByte[37]);
digitalWrite(cue39, incomingByte[38]);
digitalWrite(cue40, incomingByte[39]);
digitalWrite(cue41, incomingByte[40]);
digitalWrite(cue42, incomingByte[41]);
digitalWrite(cue43, incomingByte[42]);
}
}`