Xbee + Arduino = Chat Devices

Xbee Sender sends a string (e.g., 'hello?') to the receiver.

Xbee Receiver Code on Mega:

#include <SoftwareSerial.h>
const int xb_rx =10;
const int xb_tx =11;
SoftwareSerial xbee(xb_rx,xb_tx); 
void setup() {

void loop() {
  if (xbee.available())


Can the receiver sends the data (e.g., 'yes?') back to the sender? If yes, any suggestions to write the code? Many thanks!

Your xbee object's type is SoftwareSerial which has several methods including print() and println().

Will the


send the analog reading from a sensor back to the other Arduino via xbee?

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.