fuji-compass

Dependencies:   HMC6352 mbed

Files at this revision

API Documentation at this revision

Comitter:
com3
Date:
Sat Feb 22 08:48:03 2014 +0000
Commit message:
compass

Changed in this revision

HMC6352.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 25754a2bb950 HMC6352.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HMC6352.lib	Sat Feb 22 08:48:03 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/aberk/code/HMC6352/#83c0cb554099
diff -r 000000000000 -r 25754a2bb950 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Feb 22 08:48:03 2014 +0000
@@ -0,0 +1,17 @@
+#include "HMC6352.h"
+HMC6352 compass(p9, p10);
+
+uint8_t compassdef = 0;
+
+int main() {
+    
+    
+    compass.setOpMode(HMC6352_CONTINUOUS, 1, 20);
+    compassdef = (compass.sample() / 10);
+    
+    
+    
+    tx_data = ((compass.sample() / 10) + 540 - compassdef) % 360;
+
+}
+
diff -r 000000000000 -r 25754a2bb950 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Feb 22 08:48:03 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/8e73be2a2ac1
\ No newline at end of file