I am currently struggling with a comm’s problem. I have just started with Arduino and xbee. I have configured my xbee’s accordingly (Co ordinator AT and Router AT). Their PAN ID’s is the same and I can do a simple chat between the two xbee’s. But when I connect the co ordinator to my Arduino mega, and try to run my little program it does not work. I need the Arduino to turn on and off an LED when I send a “1” and “2” form my laptop. Both the Arduino and the xbee is connected to the same Laptop.
Use a serial monitor application to show the characters as hexadecimal values, at the same time as their normal representation. Standard Arduino serial monitor doesn’t allow this. Plenty of serial terminal software on the web to download. But XCTU is something you already should have and can do this too.
I did read the link you have send. I can see it has more TX/RX ports. How do I link them to the xbee on the shield? I have two shields a sparkfun shield and a xbee pro shield.
Regard to the other questions “What do you think the result of myData becomes when you sent the character ‘0’?” I tried to make the variable an integer by subtracting ‘0’ because, I want the output to be written as an integer. “And what integer value do you think that ‘1’ and ‘2’ means to the Arduino compiler?” The compiler should see it as an integer(a number) being send over the xbee to turn the light on and off.
I have been working with XCTU. But what ever i send over the xbee connected to the laptop, does not get to the arduino to be displayed. I can do a simple chat between the xbee’s but i can not seem to get information to be send to the arduino and to be displayed by the arduino. So i think the problem could be my programming.
I did read the link you have send. I can see it has more TX/RX ports. How do I link them to the xbee on the shield? I have two shields a sparkfun shield and a xbee pro shield.
I don’t know the details of the schematic of those shields, and don’t have the time to investigate right now. Sorry, maybe later.
Regard to the other questions “What do you think the result of myData becomes when you sent the character ‘0’?” I tried to make the variable an integer by subtracting ‘0’ because, I want the output to be written as an integer. “And what integer value do you think that ‘1’ and ‘2’ means to the Arduino compiler?” The compiler should see it as an integer(a number) being send over the xbee to turn the light on and off.
I have been working with XCTU. But what ever i send over the xbee connected to the laptop, does not get to the arduino to be displayed. I can do a simple chat between the xbee’s but i can not seem to get information to be send to the arduino and to be displayed by the arduino. So i think the problem could be my programming.
It is an integer indeed. But what valuesdo they represent? And how does that influence the decisions made in the if-statements.
If you send a character ‘1’, and subtract ‘0’ from it, can it then still be considered to have the same value as ‘1’? You may be thinking by the logic of 1-0=1, but you are wrong here.