I have a series1 XBee (http://www.sparkfun.com/products/8664
) connected to an ArduIMU (http://www.sparkfun.com/products/9956
) which is basically an arduino and a 6DOF board.
I have DIN connected to TX and DOUT connected to RX. I also have 3.3v and ground connected.
On the receiving side I have a USB shield (http://www.sparkfun.com/products/8687
) for the XBee and that's connecting directly to a laptop, which will then receive the data via Max/MSP.
The baud rate for the XBees and Arduino are set to 115200, and the DL address of my transmitting XBee is set to the MY address of the receiving one.
The code I have is working (though I'm tweaking/improving it) and it looks like this:
const int ax = A0;
const int ay = A1;
const int az = A2;
const int gx = A6;
const int gy = A7;
const int gz = A3;
Serial.print("2 ax ");
Serial.print("2 ay ");
Serial.print("2 az ");
Serial.print("2 gx ");
Serial.print("2 gy ");
Serial.print("2 gz ");
It's basically a tweaked version of the "VirtualColorMixer" example that comes built-in with the Arduino IDE.
With that code on the Arduino, I get data on my computer just fine, in both Max/MSP and Serial Monitor. Now when I transmit over the XBee I get a short spurt of data (maybe 2-3 seconds) filled with errors (I get a bunch of error messages from my parsing routine in Max/MSP) then it stops working altogether. I also tested it with serial monitor and I get the same thing (a short spurt of data, then nothing).
Is it physically connected right? (only 4 wires from the arduino to the xbee)
Is the data going across too fast or something?
I tried adding a 'delay(40)' at the end of my main loop in case data was going across too fast and it still crapped out (though I want to say it took longer to crap out, but I didn't time it or anything).