Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed XBee mbed-rtos
xbee2.cpp@6:d456c203adb6, 2012-09-20 (annotated)
- Committer:
- yamaguch
- Date:
- Thu Sep 20 11:17:17 2012 +0000
- Revision:
- 6:d456c203adb6
- Parent:
- 5:d01cf03058f6
updated for workshop
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yamaguch | 0:34e0352d7396 | 1 | #include "XBee.h" |
yamaguch | 0:34e0352d7396 | 2 | |
yamaguch | 0:34e0352d7396 | 3 | void xbee2() { |
yamaguch | 5:d01cf03058f6 | 4 | XBee xbee(p9, p10); |
yamaguch | 5:d01cf03058f6 | 5 | xbee.baud(115200); |
yamaguch | 0:34e0352d7396 | 6 | xbee.init(); |
yamaguch | 5:d01cf03058f6 | 7 | |
yamaguch | 6:d456c203adb6 | 8 | printf("*** AT Command Executions ***\n"); |
yamaguch | 0:34e0352d7396 | 9 | |
yamaguch | 0:34e0352d7396 | 10 | char *command[] = { |
yamaguch | 5:d01cf03058f6 | 11 | "SH", "SL", "MY", "MP", "DH", "DL", "ID", "OP", "CH", "HV", 0 |
yamaguch | 0:34e0352d7396 | 12 | }; |
yamaguch | 0:34e0352d7396 | 13 | |
yamaguch | 0:34e0352d7396 | 14 | for (int i = 0; command[i]; i++) |
yamaguch | 0:34e0352d7396 | 15 | xbee.sendCommand(command[i]); |
yamaguch | 0:34e0352d7396 | 16 | |
yamaguch | 0:34e0352d7396 | 17 | while (xbee.receive()) |
yamaguch | 0:34e0352d7396 | 18 | xbee.dump(); |
yamaguch | 0:34e0352d7396 | 19 | } |