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
xbee10.cpp@1:dedbc2504219, 2011-11-22 (annotated)
- Committer:
- yamaguch
- Date:
- Tue Nov 22 09:01:44 2011 +0000
- Revision:
- 1:dedbc2504219
- Child:
- 5:d01cf03058f6
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yamaguch | 1:dedbc2504219 | 1 | #include "XBee.h" |
yamaguch | 1:dedbc2504219 | 2 | |
yamaguch | 1:dedbc2504219 | 3 | void xbee10() { |
yamaguch | 1:dedbc2504219 | 4 | Serial ser(p9, p10); |
yamaguch | 1:dedbc2504219 | 5 | ser.baud(115200); |
yamaguch | 1:dedbc2504219 | 6 | XBee xbee(ser); |
yamaguch | 1:dedbc2504219 | 7 | xbee.init(); |
yamaguch | 1:dedbc2504219 | 8 | |
yamaguch | 1:dedbc2504219 | 9 | printf("Network Reset\n"); |
yamaguch | 1:dedbc2504219 | 10 | |
yamaguch | 1:dedbc2504219 | 11 | char param[] = {0x00}; |
yamaguch | 1:dedbc2504219 | 12 | xbee.sendCommand("NR", param, 1); |
yamaguch | 1:dedbc2504219 | 13 | xbee.sendCommand("OP"); |
yamaguch | 1:dedbc2504219 | 14 | xbee.sendCommand("OI"); |
yamaguch | 1:dedbc2504219 | 15 | xbee.sendCommand("CH"); |
yamaguch | 1:dedbc2504219 | 16 | |
yamaguch | 1:dedbc2504219 | 17 | while (xbee.receive()) |
yamaguch | 1:dedbc2504219 | 18 | xbee.dump(); |
yamaguch | 1:dedbc2504219 | 19 | |
yamaguch | 1:dedbc2504219 | 20 | printf("done.\n"); |
yamaguch | 1:dedbc2504219 | 21 | } |