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() {
Serial.begin(9600);
xbee.begin(9600);
}
void loop() {
//xbee.write(255);
if (xbee.available())
{
Serial.write(xbee.read());
}
}
Can the receiver sends the data (e.g., 'yes?') back to the sender? If yes, any suggestions to write the code? Many thanks!