xbee sample code with FTDI


If you received your xbees recently and want to do a super simple test, just connected one xbee to your arduino (xbee rx to arduino tx and xbee tx to arduino rx), and the other xbee to your FTDI board and connect to your computer.

On the arduino, upload this code: (note that if your xbees baud rate isn’t 9600 just change it to your velocity)

void setup () {
  Serial.begin(9600);
}
void loop () {
  for (int i=0; i<255; i++) {
    Serial.println(i);
    delay(100);
  }
}

 

Now open the arduino on your computer, select the serial port of your FTDI cable or breakout board. Click Serial Monitor, you should be able to see data coming from your arduino. This code is a loop that sends values from 0 to 255.

Note: if your baud rate isn’t 9600, you have to change to your baud rate on the serial monitor too.

This entry was posted in Tutorial and tagged , , , , , , , , , , , , , , , . Bookmark the permalink.