CMPS03 digital compass example.

Dependencies:   mbed CMPS03

Files at this revision

API Documentation at this revision

Comitter:
aberk
Date:
Thu Aug 26 11:05:49 2010 +0000
Child:
1:3eeda0cce598
Commit message:
Version 1.0

Changed in this revision

CMPS03_lib.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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/CMPS03_lib.lib	Thu Aug 26 11:05:49 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/aberk/programs/CMPS03_lib/latest
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Aug 26 11:05:49 2010 +0000
@@ -0,0 +1,18 @@
+#include "CMPS03.h"
+
+CMPS03 compass(p9, p10, CMPS03_DEFAULT_I2C_ADDRESS);
+Serial pc(USBTX, USBRX);
+
+int main() {
+
+    pc.printf("Starting CMPS03 test...\n");
+
+    while(1){
+        
+        wait(0.1);
+        
+        pc.printf("Bearing is: %f\n", compass.readBearing() / 10.0);
+    
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Aug 26 11:05:49 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/49a220cc26e0