I have two XBees:
- One is a router AT reading and sending analog data from one analog pin.
- The other is a coordinator API connected to an Arduino Mega serial port (rx1 and tx1).
Whenever I try to read from the XBee serial in the Arduino, the readings are mostly zeros (instead of data packets as they should be).
It must be noted that using xctu terminal or any other terminal I can read the correct data with no problems whatsoever.
Here is some sample code I'm using:
void setup() {
Serial1.begin(9600); // Here the XBee is connected
Serial.begin(9600);
}
void loop() {
if (Serial1.available()){
Serial.print(Serial1.read());
}
ifclause?