XBee Transmiiter Module

Dependencies:   mbed CMPS03

Files at this revision

API Documentation at this revision

Comitter:
anoop1728
Date:
Mon Feb 28 19:57:13 2011 +0000
Commit message:

Changed in this revision

CMPS03.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 4216f0191bd0 CMPS03.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/CMPS03.lib	Mon Feb 28 19:57:13 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/aberk/code/CMPS03/#c6bcc390612a
diff -r 000000000000 -r 4216f0191bd0 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Feb 28 19:57:13 2011 +0000
@@ -0,0 +1,35 @@
+#include "mbed.h"
+#include "CMPS03.h"
+
+CMPS03 compass(p9, p10, CMPS03_DEFAULT_I2C_ADDRESS);
+Serial pc(USBTX, USBRX);
+
+ Serial xbee1(p13,p14);
+ DigitalOut rst1(p8); //Digital reset for the XBee, 200ns for reset
+
+
+DigitalOut myled(LED3);//Create variable for Led 3 on the mbed
+
+int main() { 
+
+    rst1 = 0; //Set reset pin to 0
+    myled = 0;//Set LED3 to 0
+    wait_ms(1);//Wait at least one millisecond
+    rst1 = 1;//Set reset pin to 1
+    wait_ms(1);//Wait another millisecond
+    int Y;
+     
+    while (1) {//Neverending Loop
+        
+        myled = 1; //Turn Led 3 Off
+        Y=compass.readBearing();
+
+           printf("data %f \n\r", Y / 10.0);
+            xbee1.printf("%d", Y); //XBee write whatever the PC is sending
+          // xbee1.putc(Y);
+            wait(1);
+            myled = 0; //Turn Led 3 on for succcessfull communication
+            wait(1);
+        }
+    }
+
diff -r 000000000000 -r 4216f0191bd0 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Feb 28 19:57:13 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/63bcd7ba4912