Hello everyone, I allow myself to ask for help by this post because I can not find the solution to my problem. I use the latest version of vixen coupled with multiple arduino Mega, Uno and Nano. Some pixel controls and other relays. My problem is the relays, at the beginning of the configuration everything worked properly but after unplugging and reconnecting the usb plugs of the Arduino Mega and Uno to my pc, the relays is triggered randomly ... That is to say that when my relay 1 must NORMALLY turn on window 1 of my house, well relay 1 turns on window 2 .... or 5 sometimes; and the same for all the other relays that do not turn on the right windows, while everything worked perfectly when configuring the generic exit on Vixen ... I'm heading to you to find out if anyone had already had this problem . I contact you from France and I use a translator so sorry if my spelling is not good. .I wish you a wonderful end-of-year celebration
Code:
#define MEGA_VIXEN
//#define UNO_VIXEN
#ifdef MEGA_VIXEN
#define MAX_CHANNELS 52
int channels[MAX_CHANNELS] = {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,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()
{
pinMode (10, OUTPUT);
pinMode (38, OUTPUT);
int i;
Serial.begin(9600); // set up Serial at 9600 bps
for ( i = 0; i < MAX_CHANNELS; i ++ ) pinMode(channels[i], OUTPUT);
}
void loop(){
digitalWrite (10, HIGH);
digitalWrite (38, HIGH);
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]);
for (i = 0; i < MAX_CHANNELS; i ++ ) digitalWrite(channels[i], ~incomingByte[i]);
}
Attachments
Last edited: