I’m trying to use my Arduino 1 to send and receive data from others XBEE, I have 2 Arduino Mega with xbee and all works fine, but with the same code and I just replaced the hardwareSerial(Serial1) from the Arduino Mega for SoftwareSerial, but I can’t send and receive nothing, any idea?
include
#include
SoftwareSerial SerialXbee(2,3);
//Recepcion de datos
XBee DeepXbee = XBee();
XBeeResponse response = XBeeResponse();
ZBRxResponse rx = ZBRxResponse();
ModemStatusResponse msr = ModemStatusResponse();
//Envio de datos
uint8_t payload[] = {‘E’};
//int Lsb;
//int Msb;
XBeeAddress64 addr64 = XBeeAddress64(0x000000, 0x0000FFFF);
//XBeeAddress64 addr64 = XBeeAddress64(Msb,Lsb);
ZBTxRequest zbTx = ZBTxRequest(addr64, payload, sizeof(payload));
ZBTxStatusResponse txStatus = ZBTxStatusResponse();
//variables
String Mensaje = “N”;
void setup() {
Serial.begin(9600);
SerialXbee.begin(9600);
DeepXbee.setSerial(SerialXbee);
}
}