0

My receiver xbee is receiving data even if the transmitter is disconnected , so if i am sending the string hello world , the receiver will repeat this string .

void loop() {
    Serial.println("Hello");
    delay(1000);
}


void loop() {
     if(Serial.available()>0){
         Serial.print((char)Serial.read());
     }
} 
2
  • And what is the question?
    – Gerben
    Sep 17, 2014 at 10:18
  • @Gerben there is no question there is a problem Sep 17, 2014 at 16:14

1 Answer 1

1

As @Garben mentioned, we do not know what is your question, problem or whatever... Provide some more information about wiring. I looked at your question 5 mins and still can't get what is wrong...

What are you doing here??? Sending from Arduino+XBEE to another Arduino+XBEE???

void loop() {
    Serial.println("Hello");
    delay(1000);
}

Here you are resending what you got

void loop() {
     if(Serial.available()>0){
         Serial.print((char)Serial.read());
     }
} 

So what is your problem? Or is this all your code??? Arduino has to have

void setup(){
//Set up your Arduino here
}
void loop(){
//Code here will run over and over and over...
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.