How do I read this with Arduino Mega

XBee projects like the adapter, xBee tutorials, tweetawatt/wattcher, etc. from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
donaldhwong
 
Posts: 3
Joined: Thu Jan 08, 2015 3:32 am

How do I read this with Arduino Mega

Post by donaldhwong »

I have set up one Xbee Router with one Xbee Coordinator API and getting following on the Coordinator: But failed to read it Through the RX/TX of Arduino the code below:
Serial.print("begin");
if(Serial1.available() >= 21) { // This isn't important. You can do here whatever you want.
if(Serial1.read() == 0x7E) { // Reads the start byte
for(int i = 1; i < 19; i++) {
byte discardByte = Serial1.read();
rssiDur = pulseIn(digitalPin, LOW, 200);
Zigbee IO Data Sample RX Indicator

7E 00 12 92 00 13 A2 00 40 C4 58 66 A8 67 01 01 00 00 08 02 0F CC

- Start delimiter: 7E
- Length: 00 12 (18)
- Frame type: 92 (Zigbee IO Data Sample RX Indicator)
- 64-bit source address: 00 13 A2 00 40 C4 58 66
- 16-bit source address: A8 67
- Receive options: 01
- Number of samples: 01
- Digital channel mask: 00 00
- Analog channel mask: 08
- Analog sample: 02 0F
- Checksum: CC

Locked
Please be positive and constructive with your questions and comments.

Return to “XBee products (discontinued)”