Xbee shield interfacing problem

Hi!

I am trying to get two Xbee modules to communicate and have tried different things but can't get them to communicate.

I am using a Arduino Duemilanove and a Xbee Pro Shield (Libelium) for the Xbee module.

The receiver code is very basic:
#define ledPin 13 // the pin that the LED is attached to
int incomingByte; // a variable to read incoming serial data into

void setup() {
// initialize serial communication:
Serial.begin(9600);
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
}

void loop() {
if (Serial.available() > 0) {
// read the oldest byte in the serial buffer:
incomingByte = Serial.read();
if (incomingByte == 'H') {
digitalWrite(ledPin, HIGH);
}
// if it's an L (ASCII 76) turn off the LED:
if (incomingByte == 'L') {
digitalWrite(ledPin, LOW);
}
else
{
digitalWrite(ledPin, HIGH);
}
}
}

The sending module code is:
void setup() {
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
}

void loop()
{
Serial.print('H');
digitalWrite(ledPin, HIGH); //display outgoing bit on pin 13
delay(1000);
Serial.print('L');
digitalWrite(ledPin, LOW); //display outgoing bit on pin 13
delay(1000);
}

I also used freeware Serial COM port terminal program to setup the Xbee using the AT commands. As the documentation mentions the modules should work on factory settings. My default values for the two modules (which for some reason don't match the default values on the Arduino website):

MODULE1
ID = 323334\H
SH = 0000313341323030\H
SL = 3430333231323434\H
MY = 46464645\H
CH = 30\H
DH = 30\H
DL = 30\H
BD = 33\H [9600 BPS]

MODULE2
ID = 323334\H
SH = 0000313341323030\H
SL = 3430333431463144\H
MY = 46464645\H
CH = 30\H
DH = 30\H
DL = 30\H
BD = 33\H [9600 BPS]

I tried changing some of the values but just nothing seems to work.
Could someone please help me out?
Thanks!! :slight_smile: