The program above puts data on the Tx pin.
If i want to receive the data on another Ardunio (i.e. transmit the string data wirelessly), and show it on its serial monitor....how should my receiver program be like? Can some1help? :)...thankssss
I think you have to use 2 serial ports.
1 for the communication with the Xbee, and 1 to show the data what's received by the receiving Arduino on the serial port at the computer.
Maybe you can use SoftSerial for one of those 2...
The code you showed in Reply #3 should work fine. That Arduino will send "hello" to the serial port once a second. The PC attached to the USB connect AND the XBee will see the data. The PC will show the value in the Serial Monitor, if it is open, and the XBee will broadcast it.
Somewhere you need to have a receiver. That receiver will have code like this on it:
void loop()
{
 while(Serial.available() > 0)
 {
   Serial.print(Serial.read());
 }
}
Anything that arrives on the serial port, because the XBee received it over-the-air will be read by the Arduino. The Serial.print() statement will cause the data to be seen by the PC AND sent over-the-air by the XBee.
As you can see, you could get into an infinite loop sending the same data back and forth. As soon as you know that this is happening, you need to add distinguishing IDs to the messages, so the Arduino that receives the data knows whether it is its own message being echoed back, or a message originating from somewhere else.
Hey peeps, i was wondering if there is a command that gets data on the RX pin(Serial.read()) and show it on the serial monitor without sending out any data?
i know that Serial.println () writes data to the serial port. I don't want that. I just want to receive whatever data that is transmitted from another arduino and show it on the serial monitor.
If i use the command Serial.println() at the Ardunio that is receiving the data(receiver end), will i be sending the data that i have received back to the transmitter?
Or the Serial.println command will just display what i have received from the transmitter onto the serial monitor?
Cause i don't want the receiver to send the data back to the transmitter---------only the transmitter send, receiver reads and show it sent on serial monitor
If i use the command Serial.println() at the Ardunio that is receiving the data(receiver end), will i be sending the data that i have received back to the transmitter?
Or the Serial.println command will just display what i have received from the transmitter onto the serial monitor?
Cause i don't want the receiver to send the data back to the transmitter
The Serial.print(ln) command will send both.
Once you know that the XBees are sending and receiving, you don't need to see what they are sending on the serial monitor.
At the receiver end, i did not even write any program. All i did was open serial monitor with the same baud rate. I m able to get the data that i want. (i.e. receive whatever that is transmitted).
I already configured the two Xbees with the X-CTU software.
I don't understand but it seems like its correct. Can some1 explain wad is happening? Thanks!!!
i m finally able to transmit a string message wirelessly from one Arduino to another Arduino.
At the receiver end, i did not even write any program. All i did was open serial monitor with the same baud rate. I m able to get the data that i want. (i.e. receive whatever that is transmitted).
I already configured the two Xbees with the X-CTU software.
I don't understand but it seems like its correct. Can some1 explain wad is happening?
The Serial Monitor is one end of the serial connection. The Arduino with XBee is at the other end. Either the Arduino OR the XBee can put data on the serial port pins on that end.
The Serial Monitor simply reads the data on the port, without knowing (or caring) which device on the other end put the data there.
If the Arduino connected to the PC is supposed to do something with the data, too, it will need some code to read the serial data, too.
it occured to me that these two threads should be linked together. http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1289089043/30 The hardware and software is different, but the desired outcome is essentially the same. when I looked for a wireless system to check out, it seemed like a toss-up between xbee and nordic. I ultimately went with nordic, nudged along by a totorial by fritzing, and their promise of ultra-cheep modules (which I then didn't invest in.. hm.)