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
examples/xbee_enddev05.cpp@14:50ee389d681f, 2013-03-21 (annotated)
- Committer:
- yamaguch
- Date:
- Thu Mar 21 07:16:44 2013 +0000
- Revision:
- 14:50ee389d681f
- Parent:
- 10:0cb575e57f9a
updated to use new XBee lib
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yamaguch | 10:0cb575e57f9a | 1 | #include "XBee.h" |
yamaguch | 10:0cb575e57f9a | 2 | |
yamaguch | 10:0cb575e57f9a | 3 | void xbee_enddev05() { |
yamaguch | 10:0cb575e57f9a | 4 | XBee xbee(p9, p10); |
yamaguch | 10:0cb575e57f9a | 5 | xbee.baud(115200); |
yamaguch | 10:0cb575e57f9a | 6 | DigitalOut sleep_request(p11); |
yamaguch | 10:0cb575e57f9a | 7 | |
yamaguch | 10:0cb575e57f9a | 8 | sleep_request = false; // wake up |
yamaguch | 10:0cb575e57f9a | 9 | |
yamaguch | 10:0cb575e57f9a | 10 | if (xbee.init()) { |
yamaguch | 10:0cb575e57f9a | 11 | xbee.sendCommand("NI"); |
yamaguch | 10:0cb575e57f9a | 12 | xbee.sendCommand("SM"); |
yamaguch | 10:0cb575e57f9a | 13 | xbee.sendCommand("SP"); |
yamaguch | 10:0cb575e57f9a | 14 | xbee.sendCommand("ST"); |
yamaguch | 10:0cb575e57f9a | 15 | |
yamaguch | 10:0cb575e57f9a | 16 | while (xbee.receive()) |
yamaguch | 10:0cb575e57f9a | 17 | xbee.dump(); |
yamaguch | 10:0cb575e57f9a | 18 | } else { |
yamaguch | 10:0cb575e57f9a | 19 | printf("XBee initialization failed\n"); |
yamaguch | 10:0cb575e57f9a | 20 | } |
yamaguch | 10:0cb575e57f9a | 21 | |
yamaguch | 10:0cb575e57f9a | 22 | sleep_request = true; // sleep |
yamaguch | 10:0cb575e57f9a | 23 | } |