I have an arduino uno connected to a 8 channel relay board. I want to use it with Vixen 3. When I upload the code all the relays turn on. So, when i send a signal in Vixen the relay turns off. I need a way to invert this so when I send the signal from Vixen it turns on the relay. The coding side isn't really my strong point, so please go easy on me.
With love xx
int C1 = 2;
int C2 = 3;
int C3 = 4;
int C4 = 5;
int C5 = 6;
int C6 = 7;
int C7 = 8;
int C8 = 9;
int i = 0;
int incomingByte[8];
void setup()
{
Serial.begin(9600);
pinMode(C1, OUTPUT);
pinMode(C2, OUTPUT);
pinMode(C3, OUTPUT);
pinMode(C4, OUTPUT);
pinMode(C5, OUTPUT);
pinMode(C6, OUTPUT);
pinMode(C7, OUTPUT);
pinMode(C8, OUTPUT);
}
void loop()
{
if (Serial.available() >= 8) {
for (int i=0; i<=8; i++)
{
incomingByte[i] = Serial.read();
}
analogWrite(C1, incomingByte[0]);
analogWrite(C2, incomingByte[1]);
analogWrite(C3, incomingByte[2]);
analogWrite(C4, incomingByte[3]);
analogWrite(C5, incomingByte[4]);
analogWrite(C6, incomingByte[5]);
analogWrite(C7, incomingByte[6]);
analogWrite(C8, incomingByte[7]);
}
}