``//xbee router
#include <SoftwareSerial.h>
;
SoftwareSerial mySerial(10, 11); // RX, TX
// the setup routine runs once when you press reset:
int led = 13;
void setup() {
// initialize serial communication at 9600 bits per second:
pinMode(led, OUTPUT);
Serial.begin(9600);
}
I one have one xbee communicating to a second xbee (connected to UNO). I am set up in API mode on the Coordinator. I am intersted in analog data on AD1 of the router.
I receive the following
0,1,2,0,3,FF,37,7E,0,A,83,0,0,42,0,1,2,0,3,FF,35,
7E,0,A,83,0,0,3D,0,1,2,0,3,FF,3A,7E,0,A,83,0,0,46,
0,1,2,0,3,FF,31,7E,0,A,83,0,0,58,0,1,2,0,3,FF,1F,
7E,0,A,83,0,0,4F,0,1,2,0,3,FF,28,7E,0,A,83,0,0,58,
0,1,2,0,3,FF,1F,7E,0,A,83,0,0,45,0,1,2,0,3,FF,32,
7E,0,A,83,0,0,58,0,1,2,0,3,FF,1F,7E,0,A,83,0,0,52,
I am expecting the analog data to be bytes 21 - 7e is the start byte
Looks like i am only getting 13 bytes.
Comments ?
---code-- here
void loop() {
if (Serial.available()>=21){
for (int i=1;i<22;i++){
Serial.print(Serial.read(),HEX);
Serial.print(",");
}
Serial.println();
}
}