Hey I am new to Xbee configurations ...as i am using arduino board and xbee shield and xbee tranceiver to do my fire alarm project .
I am using digital fire sensor as an input & using a buzzer or LED as as an output.
So, I have done the configuration of XBEE's on Putty as shown by Mr. Jeremy Blum.
The Configuration is like this. & its Working. on my laptop
XBee 1
+++
ATDH13A200
ATDL4061318A
ATWR
ATCN
XBee2
+++
ATDH13A200
ATDL40612FEC
ATWR
ATCN
After doing this, I am programming both my arduino's but the programs are not working. The programs are..
For Fire Sensor:-
void setup()
{
Serial.begin(9600);
pinMode(11,INPUT);
}
void loop()
{
int no=digitalRead(11);
Serial.println(no);
delay(5000);
}
And for Alarm as LED is connected to pin 12.:-
void setup()
{
pinMode(12,OUTPUT);
Serial.begin(9600);
}
void loop()
{
while(Serial.available()==0);
int data=Serial.read()-'0';
if(data > 0)
digitalWrite(12,HIGH);
}
Its not giving the correct output...It's giving correct 0'1 And 1's on fire sensor side as i take lighter to generate the signal in front of sensor. but on the other side the LED is not turning HIGH
Please help me....Is there any BUG in the code and tell me about jumpers as well
My XBEE shield jumpers are on USB for uploading the program after that i change it to XBEE jumper. Is it right??