Hiroshi Yamaguchi / Mbed 2 deprecated XBeeExamples

Dependencies:   mbed XBee mbed-rtos

xbee2.cpp

Committer:
yamaguch
Date:
2012-04-12
Revision:
5:d01cf03058f6
Parent:
0:34e0352d7396
Child:
6:d456c203adb6

File content as of revision 5:d01cf03058f6:

#include "XBee.h"

void xbee2() {
    XBee xbee(p9, p10);
    xbee.baud(115200);
    xbee.init();
    
    printf("*** Execute AT commands ***\n");

    char *command[] = {
        "SH", "SL", "MY", "MP", "DH", "DL", "ID", "OP", "CH", "HV", 0
    };

    for (int i = 0; command[i]; i++)
        xbee.sendCommand(command[i]);

    while (xbee.receive())
        xbee.dump();
}