Xbee Serial Communication

I have two Xbees, each connected to an Arduino Uno. The problem is that whenever I switch the sender on, the receiver is receiving "224" (or if I used a char variable, "à") no matter what the sender is printing.

Receiver code:

void setup () { Serial.begin(57600); Serial.println("Ready1"); pinMode (8,OUTPUT);

void loop () { while(Serial.available()){ B = Serial.read();

Serial.print(B); } B=0;

if (B==224){ digitalWrite (8,HIGH);

delay(1); }

else digitalWrite (8,LOW);


Sender code:

void setup() { Serial.begin(57600);} void loop (){ Serial.print("A"); delay (1); }

The receiver code doesn’t compile. Please post code that compiles. And put it in code tags.

You can do that by hitting the # button above the posting area.

sketch_apr27c.cpp: In function 'void setup()':
sketch_apr27c:6: error: a function-definition is not allowed here before '{' token
sketch_apr27c:23: error: expected `}' at end of input
    if (B==224){

How would that if test ever be true?