Alek Boving / Mbed 2 deprecated BovingAssign9

Dependencies:   mbed LSM9DS1

Files at this revision

API Documentation at this revision

Comitter:
alekboving
Date:
Mon Nov 30 20:40:18 2020 +0000
Parent:
0:042921e9375d
Commit message:
Assignment 9 Alek Boving OCE360

Changed in this revision

LSM9DS1.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
--- a/LSM9DS1.lib	Sat Nov 28 16:42:41 2020 +0000
+++ b/LSM9DS1.lib	Mon Nov 30 20:40:18 2020 +0000
@@ -1,1 +1,1 @@
-LSM9DS1#b7bd2122cec8
+https://os.mbed.com/users/alekboving/code/LSM9DS1/#b7bd2122cec8
--- a/main.cpp	Sat Nov 28 16:42:41 2020 +0000
+++ b/main.cpp	Mon Nov 30 20:40:18 2020 +0000
@@ -9,10 +9,10 @@
 
 void mag_correction(float mx, float my, float mz, float mag_c[3])
 {
-    float bias[3] = {-0.1102,0.3965,-0.0683};
-    float scale[3][3] = {{1.0558, 0.0640, -0.0220},
-        {0.0640, 1.0657, 0.0645},
-        {-0.0220, 0.0645, 1.0650}
+    float bias[3] = {-0.1139,0.4026,-0.0621};
+    float scale[3][3] = {{1.0147, 0.0575, 0.0134},
+        {0.0575, 1.0475, 0.0291},
+        {0.0134, 0.0291, 0.9776}
     };
 
     mag_c[0] = (mx-bias[0]) *scale[0][0] + (my - bias[1]) *scale[1][0] + (mz - bias[2]) *scale[2][0];
@@ -66,6 +66,6 @@
             pitch = pitch + 360;
         }
 
-        pc.printf("$imu,4,4,%f,%3.3f,   %3.3f,  %3.3f;\r\n",t.read(),roll,pitch,yaw);
+        pc.printf("$imu,3,10,%f,%3.3f,%3.3f,%3.3f,%3.3f,%3.3f,%3.3f,%3.3f,%3.3f,%3.3f;\r\n",t.read(),gyro[0],gyro[1],gyro[2],accel[0],accel[1],accel[2],roll,pitch,yaw);
     }
 }
\ No newline at end of file