Chris LU / LSM9DS0_self_riding_bike_LQR

Fork of LSM9DS0 by Chris LU

Revision:
10:60a176bd72b3
Parent:
3:bc0db184f092
diff -r 08932ac08cb2 -r 60a176bd72b3 LSM9DS0.h
--- a/LSM9DS0.h	Tue Oct 25 06:21:28 2016 +0000
+++ b/LSM9DS0.h	Wed Dec 28 16:44:09 2016 +0000
@@ -20,6 +20,8 @@
 #define __SFE_LSM9DS0_H__
 
 #include "mbed.h"
+#include <vector>
+using std::vector;
 
 
 #define PI 3.14159
@@ -203,6 +205,10 @@
         M_ODR_50    = 0x04,   // 50 (0x04)
         M_ODR_100   = 0x05,  // 100 Hz (0x05)
     };
+    
+    // Unit transformation
+    float deg2rad; // = 3.1415926/180.0;
+    float rad2deg; // = 180.0/3.1415926;
 
     // We'll store the gyro, accel, and magnetometer readings in a series of
     // public class variables. Each sensor gets three variables -- one for each
@@ -262,6 +268,9 @@
     // The readings are stored in the class' gx, gy, and gz variables. Read
     // those _after_ calling readGyro().
     void readGyro();
+    void readGyroFloatVector_degPs(vector<float> &v_out); // Read to float array v_out[]
+    void readGyroFloatVector_radPs(vector<float> &v_out); // Read to float array v_out[]
+    void readGyroRawVector(vector<int16_t> &v_out); // Raw data in int16_t
     int16_t readRawGyroX( void );
     int16_t readRawGyroY( void );
     int16_t readRawGyroZ( void );
@@ -274,6 +283,8 @@
     // The readings are stored in the class' ax, ay, and az variables. Read
     // those _after_ calling readAccel().
     void readAccel();
+    void readAccelFloatVector(vector<float> &v_out); // Read to float array v_out[]
+    void readAccelRawVector(vector<int16_t> &v_out); // Raw data in int16_t
     int16_t readRawAccelX( void );
     int16_t readRawAccelY( void );
     int16_t readRawAccelZ( void );
@@ -286,6 +297,8 @@
     // The readings are stored in the class' mx, my, and mz variables. Read
     // those _after_ calling readMag().
     void readMag();
+    void readMagFloatVector(vector<float> &v_out); // Read to float array v_out[]
+    void readMagRawVector(vector<int16_t> &v_out); // Raw data in int16_t
     int16_t readRawMagX( void );
     int16_t readRawMagY( void );
     int16_t readRawMagZ( void );