Hello,
Eventually I would like to have a full blown christmas light display (obviously) but for now I am still trying to figure out Vixen and my Arduino Uno,
Vixen 3:
I have watched several How to Vixen videos and for the most part I believe Vixen is good to go. I have 5 single item lights, each patched to a single output on the Arduino (5 in total) and the Arduino is labeled as a generic serial controller. I have a short sequence just to test the cummunication with the Uno. I created a show and I schedule the show for time -2 minutes (is there a better way to test a show?). I made sure the baud rate and com ports match both the Arduino sketch, IDE settings and device manager.
The Arduino:
I have a simple 5 LED setup on a bread board. I have the 5 PWM outputs from the Arduino connected to the led and a resistor from the opposite leg of the led to ground and ground connected back to the arduino.
The Sketch:
/*
The purpose of this code is to allow the Arduino to use the
generic serial output of vixen lights to control 5 channels of LEDs.
Author: Matthew Strange
Created: 14 October 2010
Modifier: Ben Towner
Modified: 19-OCT-2010
Changes: Addition of 20 Digital On/Off Channels - Setup for Arduino Mega 2560
*/
// PWM Output - ChanX=PWM Pin
int Chan1 = 2;
int Chan2 = 3;
int Chan3 = 4;
int Chan4 = 5;
int Chan5 = 6;
int i = 0; // Loop counter
int incomingByte[5]; // array to store the 5 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);
}
void loop()
{ // 5 channels are coming in to the Arduino
if (Serial.available() >= 5) {
// read the oldest byte in the serial buffer:
for (int i=0; i<5; i++) {
// read each byte
incomingByte[i] = Serial.read();
}
analogWrite(Chan1, incomingByte[0]); // Write current PWM values to LED pins
analogWrite(Chan2, incomingByte[1]);
analogWrite(Chan3, incomingByte[2]);
analogWrite(Chan4, incomingByte[3]);
analogWrite(Chan5, incomingByte[4]);
}
}
Not sure about the code. I have done a few random sketches with the Uno, mostly beginner stuff but I am not certain at all about the serial detail.
Anyways, I hook up my Arudino and the sketch verifies and uploads without issue. I set my scheduler to play the show 2 min out and when the show starts there is not activity on the UNO.
See image of my Arduino. This is how it looks while the vixen is playing the sequence; cant really tell but the led labeled "L" stays on and the RX and TX remain off.
I verified all the com ports and tried different baud rates with no luck. Dont really know why it is not working. Any ideas?
I believe there is most likely several issues with the sketch and I would appreciate some help fixing it.
Thank you!
VIXEN SETTINGS.pdf (398 KB)