Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of virgo3_imuHandler_Orion_PCB by
Diff: imuHandler.cpp
- Revision:
- 13:d329bf89c898
- Parent:
- 12:6ec427e47641
- Child:
- 14:7586410ac0e6
--- a/imuHandler.cpp	Mon Aug 01 06:00:47 2016 +0000
+++ b/imuHandler.cpp	Fri Aug 19 01:13:49 2016 +0000
@@ -576,14 +576,20 @@
     mag_timer.start();  
 }
 
+void MAG_3110::magInit(int16_t off_x, int16_t off_y, int16_t off_z)
+{
+    mag_3110.begin(off_x, off_y, off_z);
+}
+
 void MAG_3110::magUpdate()
 {
     if(mag_timer.read_ms() >= mag_UpdatePeriodMS)
     {
         float mag_data[3];
         
-        mag_3110.get_uT((float*)mag_data);
+        mag_3110.get_uT(mag_data);
         
+        /*
         for(int i=0; i<3; i++) {
             movWindow_Mag[i][movWindow_index_Mag] = mag_data[i];
             Mag[i] = generalFunctions::moving_window(movWindow_Mag[i], movWindow_len_Mag);
@@ -591,6 +597,11 @@
         
         movWindow_index_Mag++;
         if(movWindow_index_Mag >= movWindow_len_Mag) movWindow_index_Mag=0;
+        */
+        
+        for(int i=0; i<3; i++) {
+            Mag[i] = mag_data[i] - Mag_Offset[i];
+        }
     
         mag_timer.reset();
     }
    