Arduino board communicates with XBee by Serial port. I'm using Arduino Mega + Sensor Shield + XBee serial 1. The TX0, RX0 (pin 0, 1) are used for the communication.
The DFRobot (
www.dfrobot.com) sells the XBee shields and modules. I'm not sure if this site is convenient for you. There are many sites around the world sell the arduino related modules. You can select a convenient one.
You can treat the XBee module as a wireless serial port. It will automatically transmit the data you send to serial port to the air. There is nothing special when wirte the code. I pasted a simple serial port test code below.
const int ledPin = 13; // the number of the LED pin
void setup() {
// initialization
Serial.begin(9600);
Serial.write("Hello world");
digitalWrite(ledPin, HIGH);
}
void loop() {
// Do the things.
//Serial.write("Hello world");
//delay(1000);
if(Serial.available())
{
int c = Serial.read();
switch(c)
{
case 'a':
Serial.write("Receive a\r\n");
digitalWrite(ledPin, HIGH);
break;
case 'b':
Serial.write("Receive b\r\n");
digitalWrite(ledPin, LOW);
break;
}
}
}
To use the XBee modules, what you need to do is configure them, so that they can set up the wireless network.
You can get more details regarding how to configure the XBee module at
http://arduino.cc/en/Main/ArduinoXbeeShield .