Home/Support/Support Forum/LEDs, Arduino, Xbee Shield, Xbee HELP

LEDs, Arduino, Xbee Shield, Xbee HELP

0 votes
I am at a roadblock and I need some serious help. No time for intros, so here is my setup.

2x Arduino Uno R3 (We'll call them Arduino1 and Arduino2)
2x SainSmart XBee Shield
2x XBee Pro Series 1 60mw
2x 75mm Bars - 12V Digital RGB LED Pixels from adafruit.com

As of right now I have Vixen3 lighting software on one computer through USB controlling one strand of the pixels on Pins 2 and 3 on Arduino1 with no problems. I am having trouble sending the data from Arduino1 to Arduino2 with the XBee to recreate what is happening on Arduino1 without having to use another computer. I have posted the code that I am using to control the LEDs on Arduino1, most of the code is borrowed. I really could use some help on this one because my head hurts from banging it against the wall.
#include "Adafruit_WS2801.h" #include "SPI.h" #define DPIN 2 #define CPIN 3 int PixelCount = 21; int bugLevel = 0; Adafruit_WS2801 strip = Adafruit_WS2801(21, DPIN, CPIN); void setup() { delay(100); strip.begin(); strip.show(); Serial.begin(115200); } void loop() { if (Serial.available()>2) { waitForVixenHeader(); for (int pixCount=0; pixCount<PixelCount;pixCount++) { int RGB[3]; for (int color = 0;color<3;color++) { while (Serial.available() < 1) { delay(10); } RGB[color] = Serial.read(); } strip.setPixelColor(pixCount,RGB[0],RGB[1],RGB[2]); } strip.show(); } } void waitForVixenHeader() { char *header="VIXStart"; char buffer[3]; 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; } } }
asked Apr 3, 2014 in RF Solutions and XBee by mattyams New to the Community (0 points)

Please log in or register to answer this question.

1 Answer

0 votes
This is not something that we can provide you the answers to. Where you want to go is an Arduino forum or a forum for the LED's and not the radios. Although try sending a broadcast packet instead of a unicast packet and see if that helps.
answered May 5, 2014 by mvut Veteran of the Digi Community (15,320 points)