I have two teensy's with octows2811's but I can only get the first RJ45 to work on each octows2811 what am I missing?
Code:
/*
************************ Heinz Doessegger - www.technikfreak.ch ******************************
Vchristmas v1.0 - January 2015
Documentation for the project:
Http://www.technikfreak.ch/category/technik-elektronik/technik-elektronik-projekte/technik-elektronik-projekte-weihnachtsbeleuchtung/
HARDWARE: TEENSY 3.1 / 3.2
ARDUINO PLUGIN: TEENSYDUINO with OctoWS2811 library
Http://www.pjrc.com/teensy/td_download.html
LED: WS2811
SOFTWARE: Vixen Lights 3.x
Program to control WS2811 RGB LED by Vixen Lights 3.x http://www.vixenlights.com/
DISPLAY CONFIGURATION - COMx (x = COM port of Arduino) 115200, None, 8 One
SEND A TEXT HEADER: VIXStart
Channels: Pro LED requires 3 channels (red / green / blue)
Color Handling: RGB
TIP: For beginners
Start with a 50 series LED. LedsPerStrip and PixelCount to 50.
In Vixen Lights, create 50 LED elements and map to 150 outputs via the Color Handling RGB.
************************ Heinz Doessegger - www.technikfreak.ch ******************************
*/
#include <OctoWS2811.h>
const int ledsPerStrip = 1200; // Maximum number of pixels per string
int PixelCount = 4800; // Effective number of pixels
float hell = .65; // Dimmer 1.00 = 100% brightness - 0.50 = 50% brightness
DMAMEM int displayMemory[ledsPerStrip*6];
int drawingMemory[ledsPerStrip*6];
const int config = WS2811_GRB | WS2811_800kHz;
OctoWS2811 leds(ledsPerStrip, displayMemory, drawingMemory, config);
int pixelValue = 0;
void setup()
{
delay(300);
Serial.begin(115200); // Speed of data transmission from Vixen Lights 3 to the Arduino
leds.begin();
for (int i=0;i<PixelCount;i++) // Initialization - Once all LEDs light up blue
{
leds.setPixel(i, 200*hell, 0, 0);
}
leds.show();
delay (5000);
for (int i=0;i<PixelCount;i++)
{
leds.setPixel(i, 0, 0, 0);
}
leds.show();
}
void loop()
{
if (Serial.available()>5) // Wait for data transmission from Vixen Lights
{
waitForVixenHeader(); // Call function: Waiting for start string
for (int pixCount=0; pixCount<PixelCount;pixCount++) // Do this for as many Pixels defined in PixelCount
{
int RGB[3]; // Array for the three RGB color valuesArray for the three RGB color values
for (int color = 0;color<3;color++) // Three values each form one RGB LED
{
while (Serial.available() < 1) // Wait for the next number
{
delay(10);
}
RGB[color] = int(Serial.read()*hell); // Assign color value to the array with brightness correction
} // Repeat until all three values are read
leds.setPixel(pixCount, RGB[1], RGB[0], RGB[2]);
} // Repeat until all LEDs are read
leds.show(); // Activate color patterns
} // Get the next color pattern
} // Loop end
void waitForVixenHeader()
{
char *header="VIXStart";
char buffer[8];
int index = 0;
while (true)
{
int inByte = Serial.read();
if(inByte==-1)
{
continue;
}
buffer[index] = inByte;
if(buffer[index]!=header[index])
{
index=-1;
}
buffer[index+1] = 0;
index++;
if(index==8)
{
return;
}
}
}