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/xbee09.cpp@7:39deffbdcae4, 2012-09-26 (annotated)
- Committer:
- yamaguch
- Date:
- Wed Sep 26 06:13:30 2012 +0000
- Revision:
- 7:39deffbdcae4
- Parent:
- xbee9.cpp@6:d456c203adb6
renamed function names
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 | 7:39deffbdcae4 | 3 | void xbee09() { |
yamaguch | 6:d456c203adb6 | 4 | XBee xbee(p9, p10, 2, true); |
yamaguch | 5:d01cf03058f6 | 5 | xbee.baud(115200); |
yamaguch | 0:34e0352d7396 | 6 | xbee.init(); |
yamaguch | 0:34e0352d7396 | 7 | |
yamaguch | 6:d456c203adb6 | 8 | XBeeAddress64 destination(0x0013A20040606567); |
yamaguch | 5:d01cf03058f6 | 9 | printf("Destination: %s\n", (char *) destination); |
yamaguch | 6:d456c203adb6 | 10 | xbee.setDestination(destination); |
yamaguch | 5:d01cf03058f6 | 11 | |
yamaguch | 5:d01cf03058f6 | 12 | xbee.printf("Comment allez-vous?\n"); |
yamaguch | 5:d01cf03058f6 | 13 | printf("sent: Comment allez-vous?\n"); |
yamaguch | 0:34e0352d7396 | 14 | |
yamaguch | 5:d01cf03058f6 | 15 | while (true) { |
yamaguch | 5:d01cf03058f6 | 16 | if (xbee.receive() == XBee::ZigBeeReceivePacket) { |
yamaguch | 5:d01cf03058f6 | 17 | XBeeReceivedData data; |
yamaguch | 5:d01cf03058f6 | 18 | xbee.scan(data); |
yamaguch | 5:d01cf03058f6 | 19 | |
yamaguch | 5:d01cf03058f6 | 20 | printf("received: %s\n", (char *) data); |
yamaguch | 5:d01cf03058f6 | 21 | break; |
yamaguch | 0:34e0352d7396 | 22 | } |
yamaguch | 5:d01cf03058f6 | 23 | } |
yamaguch | 0:34e0352d7396 | 24 | } |