Xbee test 2

Dependencies:   XBee mbed

Revision:
0:ffac63d6a7f0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Jul 21 04:08:27 2012 +0000
@@ -0,0 +1,33 @@
+#include "mbed.h"
+#include "XBee.h"
+
+XBee xbee(p13, p14);
+Serial pc(USBTX, USBRX);
+
+int main() {
+
+    uint8_t Cmd[] = {'D', '4'};
+    uint8_t Low[] = {0x04};
+    uint8_t High[] = {0x05};
+    XBeeAddress64 remoteAddress(0x0013A200, 0x403A8C82);
+    RemoteAtCommandRequest remoteAtRequest;
+
+    wait(1);
+    xbee.begin(115200);
+
+    while(1){
+//    remoteAtRequest = RemoteAtCommandRequest(remoteAddress, Cmd, Low, sizeof(Low));
+       remoteAtRequest = RemoteAtCommandRequest(remoteAddress, Cmd, Low, sizeof(Low));
+//     remoteAtRequest = RemoteAtCommandRequest(remoteAddress, Cmd);
+       remoteAtRequest.setApplyChanges(true);
+       xbee.send(remoteAtRequest);
+       
+       wait(1.0);
+       remoteAtRequest = RemoteAtCommandRequest(remoteAddress, Cmd, High, sizeof(High));
+//     remoteAtRequest = RemoteAtCommandRequest(remoteAddress, Cmd);
+       remoteAtRequest.setApplyChanges(true);
+       xbee.send(remoteAtRequest);
+       wait(1.0);       
+
+    }
+}