Hiroshi Yamaguchi / Mbed 2 deprecated XBeeExamples

Dependencies:   mbed XBee mbed-rtos

Revision:
5:d01cf03058f6
Parent:
0:34e0352d7396
Child:
6:d456c203adb6
--- a/xbeeio2.cpp	Mon Nov 28 01:59:03 2011 +0000
+++ b/xbeeio2.cpp	Thu Apr 12 10:21:11 2012 +0000
@@ -1,24 +1,17 @@
 #include "XBee.h"
 
 void xbeeio2() {
-    Serial ser(p9, p10);
-    ser.baud(115200);   
-    XBee xbee(ser);
+    XBee xbee(p9, p10);
+    xbee.baud(115200);
     xbee.init();
 
-    unsigned long long destination = 0x0013A20040666193;
-    printf("Destination (0x0013A200XXXXXXXX) => ");
-    scanf("%llx", &destination);
-    printf("xbee.setDestination(0x%0llX)\n", destination);
-    xbee.setDestination(destination);
+    xbee.setDestination(XBeeAddress64(0x0013A200, 0x40666193));
 
-    char param[1];
     for (int i = 0; i < 60; i++) {
-        param[0] = 4 + (i % 2);
-        xbee.sendRemoteCommand("P2", param, sizeof(param));
+        xbee.sendRemoteCommand("P2", 4 + (i % 2));
         xbee.receive();
         xbee.dump();
-        wait(1.0);
+        wait(1);
     }
 
     printf("done.\n");