Bonjour,
Utilisateur d'une carte Arduino M?ga avec le logiciel Vixens depuis 1 an afin d'alimenter en On/OFF des guirlandes de Noel, je pr?vois de passer sur Xlight cette ann?e.
Or je n'arrive pas ? impl?menter ma configuration pass?e (et donc fonctionnelle sur Vixens) sur Xlight.
Pourriez vous m'aider svp ?
Voici le code televerser sur la carte Arduino
Good morning,
User of an Arduino Mega card with Vixens software for 1 year in order to power Christmas garlands on/off, I plan to switch to Xlight this year.
But I can't do it? implement my past configuration (and therefore functional on Vixens) on Xlight.
Could you help me please ?
Here is the code uploaded to the Arduino board
La configuration dans Vixens qui fonctionne est aussi fourni.
Merci de votre aide
Utilisateur d'une carte Arduino M?ga avec le logiciel Vixens depuis 1 an afin d'alimenter en On/OFF des guirlandes de Noel, je pr?vois de passer sur Xlight cette ann?e.
Or je n'arrive pas ? impl?menter ma configuration pass?e (et donc fonctionnelle sur Vixens) sur Xlight.
Pourriez vous m'aider svp ?
Voici le code televerser sur la carte Arduino
Good morning,
User of an Arduino Mega card with Vixens software for 1 year in order to power Christmas garlands on/off, I plan to switch to Xlight this year.
But I can't do it? implement my past configuration (and therefore functional on Vixens) on Xlight.
Could you help me please ?
Here is the code uploaded to the Arduino board
Code:
#define MEGA_VIXEN
//#define UNO_VIXEN
#ifdef MEGA_VIXEN
#define MAX_CHANNELS 32
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};
#endif
#ifdef UNO_VIXEN
#define MAX_CHANNELS 8
int channels[MAX_CHANNELS] = {2, 3, 4, 5, 6, 7, 8, 9};
#endif
#define POWER_UP_STATE HIGH //0 = Lights off at power up, 255 = lights on at power up
#define INACTIVITY_STATE LOW //0 = Lights off when inactive, 255 = lights on when inactive
#define INACTIVITY_TIMEOUT_MILLISECONDS (5UL * 1000UL) // 5 = 5 seconds, 1000 = 1000 milliseconds in a second
int incomingByte[MAX_CHANNELS];
unsigned long inactivityTimer;
void setup()
{
int i;
Serial.begin(9600); // set up Serial at 9600 bps
for ( i = 0; i < MAX_CHANNELS; i ++ )
{
pinMode(channels[i], OUTPUT);
digitalWrite(channels[i], POWER_UP_STATE);
}
inactivityTimer = millis();
}
void loop()
{
int i;
if (Serial.available() >= MAX_CHANNELS)
{
for (i = 0; i < MAX_CHANNELS; i ++) incomingByte[i] = Serial.read();
inactivityTimer = millis();
}
if ( (millis() - inactivityTimer) >= INACTIVITY_TIMEOUT_MILLISECONDS )
{
for ( i = 0; i < MAX_CHANNELS; i ++ ) incomingByte[i] = INACTIVITY_STATE;
}
for (i = 0; i < MAX_CHANNELS; i ++ ) digitalWrite(channels[i], ~incomingByte[i]);
}
Merci de votre aide
Attachments
Last edited: