About setting up communication between XBee Pro

Hi all,

In a recent project, I want to capture the acceleration data from an acceleromter and send to my PC through a pair of Xbee Pro tranceivers. I had got all the components ready, but i need to prepare a program for the devices.

I am very new in this field…however, I still need to make this prototype for my project…

Could anyone give me advice how could i get started to program??? Is there any simple program code existed which i can make good use of?

Here’s my component:

Sensor board:

1 Arduino Main Board

sku: DEV-00666

1 XBee Shield

sku: WRL-09588

1 Triple Axis Accelerometer Breakout - ADXL345

sku: SEN-09156

Receiver Board:

1 XBee Pro 60mW Wire Antenna

sku: WRL-08742

1 XBee Explorer USB

sku: WRL-08687

Thank you very much. I really need your help…

You send data from Arduino to XBee through a simple serial connection to the XBee’s DIN pin. Open a serial connection to that pin, at 9600 baud, 8N1, which is what the XBee will expect by default. Read the acceleration data into three variables in your Arduino. Then send them out through that serial connection

MySerial.print(“AC”); // Send a code that will tell the receiver that these are data from our remote.

MySerial.print(“,”);

MySerial.print(XVolt);

MySerial.print(“,”);

MySerial.print(YVolt);

MySerial.print(“,”);

MySerial.println(ZVolt);

On the receiver side, do Serial.read (like you see here - http://arduino.cc/en/Serial/Read ) until you get your header values (the “AC” and comma), then read the X voltage, read and discard a comma, read the Y voltage, read and discard the last comma, read the Z voltage. The header is there to line you up nicely so that you know which voltage it is that you’re reading, since you could come in somewhere in the middle otherwise.

If all you’re doing on the receiver side is reading the data from the XBee Explorer into a terminal window or something of that sort, of course you can ignore this Serial.read stuff.