Hello world program showing use of xbee-lib. Receiver program, just returns data sent to it.

Dependencies:   mbed xbee_lib

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "xbee.h"
00003 
00004 xbee xbee1(p9,p10,p11); //Initalise xbee_lib
00005 
00006 int main()
00007 {
00008     char read_data[202]; //Xbee buffer size is 202 bytes
00009 
00010     while(1) {
00011         xbee1.RecieveData(read_data,0); //Read data from the XBee
00012         xbee1.SendData(read_data); //Send data to XBee
00013     }
00014 }