default eCompass example, but with desired serial communication

Dependencies:   MAG3110 MMA8451Q SLCD eCompass_Lib mbed-rtos mbed

Fork of KL46_eCompass by Jim Carver

Files at this revision

API Documentation at this revision

Comitter:
Kosinkadink
Date:
Fri Apr 08 04:43:29 2016 +0000
Parent:
6:f68052364f92
Commit message:
good stuff m9

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r f68052364f92 -r d932835d9613 main.cpp
--- a/main.cpp	Tue Apr 05 23:17:29 2016 +0000
+++ b/main.cpp	Fri Apr 08 04:43:29 2016 +0000
@@ -36,7 +36,8 @@
 //
 void debug_print(void)
 {
-    pc.printf("0,%d$",axis6.yaw);
+    //pc.printf("0,%d$",axis6.yaw);
+    pc.printf("%4.2f,%4.2f$",axis6.fUTmx, axis6.fUTmy);
     //int h, m, s;
     //h = seconds / 3600;
     //m = (seconds % 3600) / 60;
@@ -56,14 +57,14 @@
 //
 void hal_map( MotionSensorDataCounts * acc_data, MotionSensorDataCounts * mag_data)
 {
-    int16_t t;
+    //int16_t t;
     // swap and negate accelerometer x & y
-    t = acc_data->y;
-    acc_data->y = acc_data->x * -1;
-    acc_data->x = t * -1;
+    //t = acc_data->y;
+    //acc_data->y = acc_data->x * -1;
+    //acc_data->x = t * -1;
 
     // negate magnetometer y
-    mag_data->y *= -1;
+    //mag_data->y *= -1;
     
 }
 
@@ -80,7 +81,7 @@
         if(!(l % 10)) lcdp->signal_set(0x04);
         if(l++ >= 50) { // take car of business once a second
             seconds++;
-            calibrate->signal_set(0x2);
+            //calibrate->signal_set(0x2);
             //debugp->signal_set(0x01);
             l = 0;
             green = !green;
@@ -92,9 +93,9 @@
 void calibrate_thread(void const *argument) {
     while(true) {
         Thread::signal_wait(0x2); 
-        red = 0;
-        compass.calibrate();
-        red = 1;
+        //red = 0;
+        //compass.calibrate();
+        //red = 1;
         }
 }