I have a realy weird problem with my xBee S1 Pro moduls. I used the XCTU software to configure them. I set one Arduino to recive data and the other one to transmit. When i use the XCTU Software to send some testframes, it works, the reciver gets the data. But if i want my arduinos to communicate it dosent work. I assume that the moduls are configured the right way because PC -> Arduino works. So i'll provide the Sketches so you can tell me whats going wrong
reciver
void setup()
{
pinMode(13, OUTPUT);
Serial.begin(9600);
}
void loop()
{
if(Serial.available() > 0){
digitalWrite(13, HIGH);
delay(500);
digitalWrite(13, LOW);
Serial.print("recived some data: ");
Serial.println(Serial.read());
Serial.flush();
}
}
and now the sender
void setup()
{
pinMode(13, OUTPUT);
Serial.begin(9600);
}
void loop()
{
Serial.println("data");
Serial.flush();
digitalWrite(13, HIGH);
delay(1000);
digitalWrite(13, LOW);
delay(4000);
}
whats wrong? any ideas?