Serial Communication with xbee 865LP


I am trying to send data over xbee and and generate DO on arduino board. First let me inform, i am using arduino equivalent board with ATMega8 ( so i think software serial is not available). Second, i am using digi 865LP module to receive/transmit serial data .( My set-up : i have connected one xbee module by USB connector and set target module ID DH and DL ( you can find this para by selection XB8 in X-CTU ) then simply connected DOUT (of receiver xbee) to PIN 1 (Rx of arduino) and DIN (of receiver xbee) to PIN 0 (tx of arduino)

i hv downloaded following program in arduino, so if i send "1" from keayboard (ASCII) LED should turn ON.

int doPin = 13; int inbyte = 0; void setup(){ Serial.begin(9600); pinMode(doPin, OUTPUT); }

void loop() { if(Serial.available() > 0) { inbyte = Serial.parseInt(); if (inbyte == 49){ digitalWrite(doPin, HIGH); } }


inbyte == 49 to convert ASCII "1" into integer "1" used Serial.paseInt() - so other than integer data is ignored (like ENTER or MOUSE click)

if i am sending "1" from XCTU terminal (appears in blue) , it echos me back with red fonts (that means data is received by target module - i made such setting in target xbee) but LED on board is not glowing.

Then after i have tried to send "1" by "arduino serial monitor" again LED does not glow, but this time i am receiving "1." (One followed by dot) in XCTU terminal. Means data is getting transmit but program is not working - i guess.

please help me - My target is : to sense DIs from one arduino - transmit them by Xbee > receive them by xbee - generate DOs in another arduino.

Please let me know if further clarification is required in my above description. Thanks, Bhargav

so if i send "1" from keayboard (ASCII) LED should turn ON.

If you send "1", the parseInt() method will return 1, not 49.