Dependencies:   mbed

Revision:
0:fa4993a8ccac
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Feb 20 07:38:40 2012 +0000
@@ -0,0 +1,33 @@
+//Programming for XBEE at Ngee Ann Polytechnic Electrical Engineering Final Year Project Part1(Bus1)//
+
+#include "mbed.h"
+
+Serial xbee1(p9, p10);
+
+DigitalOut rst1(p11);
+
+DigitalOut myled(LED1);
+DigitalOut myled1(LED2);
+
+int main() {
+    char bus;
+    
+
+    rst1   = 0;
+    myled  = 0;
+    myled1 = 0;
+    wait_ms(1);
+    rst1   = 1;
+    wait_ms(1);
+
+    while (1) {
+        if (xbee1.writeable()) {
+            printf("xbee is writeable\n");
+            xbee1.printf("r"); 
+            wait(0.1);
+            printf("r is written\n");
+           // bus = xbee1.getc();
+           // printf("%c\n", bus);
+        }
+    }
+}
\ No newline at end of file