Hiroshi Yamaguchi / Mbed 2 deprecated XBeeExamples

Dependencies:   mbed XBee mbed-rtos

Revision:
6:d456c203adb6
Parent:
5:d01cf03058f6
--- a/xbeeio5.cpp	Thu Apr 12 10:21:11 2012 +0000
+++ b/xbeeio5.cpp	Thu Sep 20 11:17:17 2012 +0000
@@ -5,13 +5,10 @@
     xbee.baud(115200);
     xbee.init();
 
-    xbee.setDestination(XBeeAddress64(0x0013A200, 0x40666193));
-
-    xbee.sendRemoteCommand("D1", 2);
+    xbee.setDestination(XBeeAddress64(0x0013A200, 0x40310E99));
 
-    // clear receive buffer
-    while (xbee.receive())
-        ;
+    xbee.sendRemoteCommand("D1", 2); // analog input
+    while (xbee.receive());          // clear receive buffer
 
     for (int i = 0; i < 60; i++) {
         xbee.sendRemoteCommand("IS");
@@ -20,7 +17,7 @@
             xbee.scan(data);
             
             IOSample sample(data);
-            printf("AD1 = %3.2fV\n", 3.3 * sample.ad[1] / 1023);
+            printf("AD1 = %3.2fV\n", 1.2 * sample.ad[1] / 1023);
         }
         wait(1);
     }