AdvRobot_Team / LSM9DS1_ADVRO

Dependents:   LSM9DS1_SPI

Revision:
1:c2804ae02c80
Parent:
0:50166e25abb5
--- a/LSM9DS1.h	Wed Jun 21 07:11:09 2017 +0000
+++ b/LSM9DS1.h	Wed Jun 21 09:06:09 2017 +0000
@@ -66,12 +66,16 @@
     // axis. Call readGyro(), readAccel(), and readMag() first, before using
     // these variables!
     // These values are the RAW signed 16-bit readings from the sensors.
-    int16_t gx, gy, gz; // x, y, and z axis readings of the gyroscope
-    int16_t ax, ay, az; // x, y, and z axis readings of the accelerometer
-    int16_t mx, my, mz; // x, y, and z axis readings of the magnetometer
+    float   gBias[3], aBias[3], mBias[3];
+    int16_t gBiasRaw[3], aBiasRaw[3], mBiasRaw[3];
+    float   gx, gy, gz;
+    int16_t gxRaw, gyRaw, gzRaw; // x, y, and z axis readings of the gyroscope
+    float   ax, ay, az;
+    int16_t axRaw, ayRaw, azRaw; // x, y, and z axis readings of the accelerometer
+    float   mx, my, mz;
+    int16_t mxRaw, myRaw, mzRaw; // x, y, and z axis readings of the magnetometer
     int16_t temperature; // Chip temperature
-    float gBias[3], aBias[3], mBias[3];
-    int16_t gBiasRaw[3], aBiasRaw[3], mBiasRaw[3];
+    
     
     
     
@@ -149,41 +153,7 @@
     * Output:
     *  A 16-bit signed integer with sensor data on requested axis.
     */
-    int16_t readGyro(lsm9ds1_axis axis);
-    
-    /** readGyroFloatVectorRad() -- Read the gyroscope output registers.
-    * This function will read all six gyroscope output registers and 
-    * transform the data into rad/s^2 unit.
-    * The readings are stored in the class' gx, gy, and gz variables. Read
-    * those _after_ calling readGyro().
-    */
-    void readGyroFloatVectorRad(vector<float> &v_out);
-    
-    /** readGyroFloatVectorDeg() -- Read the gyroscope output registers.
-    * This function will read all six gyroscope output registers and 
-    * transform the data into rad/s^2 unit.
-    * The readings are stored in the class' gx, gy, and gz variables. Read
-    * those _after_ calling readGyro().
-    */
-    void readGyroFloatVectorDeg(vector<float> &v_out);
-    
-    /** float readGyroFloatRad(axis) -- Read a specific axis of the gyroscope in rad/s^2 unit.
-    * [axis] can be any of X_AXIS, Y_AXIS, or Z_AXIS.
-    * Input:
-    *  - axis: can be either X_AXIS, Y_AXIS, or Z_AXIS.
-    * Output:
-    *  A float with sensor data on requested axis.
-    */
-    float readGyroFloatRad(lsm9ds1_axis axis);
-    
-    /** float readGyroFloatDeg(axis) -- Read a specific axis of the gyroscope in rad/s^2 unit.
-    * [axis] can be any of X_AXIS, Y_AXIS, or Z_AXIS.
-    * Input:
-    *  - axis: can be either X_AXIS, Y_AXIS, or Z_AXIS.
-    * Output:
-    *  A float with sensor data on requested axis.
-    */
-    float readGyroFloatDeg(lsm9ds1_axis axis);
+    float readGyro(lsm9ds1_axis axis);
     
     /** readAccel() -- Read the accelerometer output registers.
     * This function will read all six accelerometer output registers.
@@ -199,25 +169,7 @@
     * Output:
     *  A 16-bit signed integer with sensor data on requested axis.
     */
-    int16_t readAccel(lsm9ds1_axis axis);
-    
-    /** readAccel() -- Read the accelerometer output registers.
-    * This function will read all six accelerometer output registers and 
-    * transform the data into m/s^2 unit.
-    * The readings are stored in the class' ax, ay, and az variables. Read
-    * those _after_ calling readAccel().
-    */
-    void readAccelFloatVector(vector<float> &v_out);
-    
-    /** float readAccelFloat(axis) -- Read a specific axis of the accelerometer.
-    * [axis] can be any of X_AXIS, Y_AXIS, or Z_AXIS.
-    * Input:
-    *  - axis: can be either X_AXIS, Y_AXIS, or Z_AXIS.
-    * Output:
-    *  A float with sensor data on requested axis.
-    */
-    float readAccelFloat(lsm9ds1_axis axis);
-    
+    float readAccel(lsm9ds1_axis axis);
     
     /** readMag() -- Read the magnetometer output registers.
     * This function will read all six magnetometer output registers.
@@ -233,7 +185,7 @@
     * Output:
     *  A 16-bit signed integer with sensor data on requested axis.
     */
-    int16_t readMag(lsm9ds1_axis axis);
+    float readMag(lsm9ds1_axis axis);
 
     /** readTemp() -- Read the temperature output register.
     * This function will read two temperature output registers.