First of all I’m french, sorry for my english
Hi, I’m using 2 Xbee PRO S2C with 2 Arduino Mega 2560.
I want to send informations between 2 arduinos.
I’ve made many researches and I can’t find a solution.
I have the great code to send informations on the first Mega 2560 with the first Xbee, when I connect the second Xbee on XCTU I can see that he receives informations.
My problem is I can’t receive informations when I connect the second Xbee on the second Mega 2560. I try a lot of codes but no results.
My second xbee was connect with a shield on pin 2 and 3 and I saw that all the pins of Arduino Mega can not support high speed transmissions. So now My xbee is connect with wires to the Mega
Not all pins on the Mega and Mega 2560 support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 14, 15, 50, 51, 52, 53, A8 (62), A9 (63), A10 (64), A11 (65), A12 (66), A13 (67), A14 (68), A15 (69).
Here is my code for the receiver :
#define rxPin 13
#define txPin 19
int var = 0 ;
SoftwareSerial xbee = SoftwareSerial(rxPin, txPin);
Serial.println(“Starting XBee Comunication”);
Serial.println(“Waiting for XBe”);
var = xbee.read() ;
I suppose that there is a problem with the serials.
Stand.ino (379 Bytes)