Honeywell HMC6352 digital compass example.

Dependencies:   mbed HMC6352

Files at this revision

API Documentation at this revision

Comitter:
aberk
Date:
Thu Aug 26 10:54:06 2010 +0000
Child:
1:67f60f68719f
Commit message:

Changed in this revision

HMC6352_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/HMC6352_lib.lib	Thu Aug 26 10:54:06 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/aberk/programs/HMC6352_lib/latest
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Aug 26 10:54:06 2010 +0000
@@ -0,0 +1,21 @@
+#include "HMC6352.h"
+
+HMC6352 compass(p9, p10);
+Serial pc(USBTX, USBRX);
+
+int main() {
+
+    pc.printf("Starting HMC6352 test...\n");
+    
+    //Continuous mode, periodic set/reset, 20Hz measurement rate.
+    compass.setOpMode(HMC6352_CONTINUOUS, 1, 20);
+
+    while (1) {
+
+        wait(0.1);
+
+        pc.printf("Heading is: %f\n", compass.sample() / 10.0);
+
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Aug 26 10:54:06 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9114680c05da