General IMU Library

Dependencies:   mbed LSM9DS1_Library

Revision:
2:ae1bfb236387
Parent:
0:0a3c6797d2ed
Child:
3:3b572eec3f20
--- a/IMU.h	Thu Feb 09 20:14:25 2017 +0000
+++ b/IMU.h	Thu Feb 16 18:25:00 2017 +0000
@@ -0,0 +1,49 @@
+/**
+*   @file   IMU.h
+*
+*   @brief  Class for reading the accelerometer
+*
+*   @author Terrabots Team
+*
+*/
+
+#ifndef IMU_H
+#define IMU_H
+ 
+#include "mbed.h"
+#include "LSM9DS1.h"
+
+class IMU {
+    public:
+        /**
+        *   Constructor for the IMU
+        *
+        *   @param[in] _state
+        */
+        IMU();
+        IMU() : _I(p9, p10, 0xD6, 0x3C){};
+        /**
+        *   Track the angle of the truck bed
+        */
+        void trackBed();
+        /**
+        *   Track the angle of the truck as it moves
+        */
+        void trackHeading();
+        
+    private:
+        bool state;
+        float ax01;
+        float ay01;
+        float az01;
+        float ax0;
+        float ay0;
+        float az0; 
+        float ax;
+        float ay;
+        float az;
+        float theta;
+        LSM9DS1 _I;
+};
+
+#endif
\ No newline at end of file