General IMU Library
Dependencies: mbed LSM9DS1_Library
IMU.h@4:ab08a70e0d7d, 2017-02-16 (annotated)
- Committer:
- simplyellow
- Date:
- Thu Feb 16 20:31:35 2017 +0000
- Revision:
- 4:ab08a70e0d7d
- Parent:
- 3:3b572eec3f20
fixed compile issues.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jcallahan1 | 2:ae1bfb236387 | 1 | /** |
jcallahan1 | 2:ae1bfb236387 | 2 | * @file IMU.h |
jcallahan1 | 2:ae1bfb236387 | 3 | * |
jcallahan1 | 2:ae1bfb236387 | 4 | * @brief Class for reading the accelerometer |
jcallahan1 | 2:ae1bfb236387 | 5 | * |
jcallahan1 | 2:ae1bfb236387 | 6 | * @author Terrabots Team |
jcallahan1 | 2:ae1bfb236387 | 7 | * |
jcallahan1 | 2:ae1bfb236387 | 8 | */ |
jcallahan1 | 2:ae1bfb236387 | 9 | |
jcallahan1 | 2:ae1bfb236387 | 10 | #ifndef IMU_H |
jcallahan1 | 2:ae1bfb236387 | 11 | #define IMU_H |
simplyellow | 4:ab08a70e0d7d | 12 | |
jcallahan1 | 2:ae1bfb236387 | 13 | #include "mbed.h" |
jcallahan1 | 2:ae1bfb236387 | 14 | #include "LSM9DS1.h" |
jcallahan1 | 2:ae1bfb236387 | 15 | |
jcallahan1 | 2:ae1bfb236387 | 16 | class IMU { |
jcallahan1 | 2:ae1bfb236387 | 17 | public: |
jcallahan1 | 2:ae1bfb236387 | 18 | /** |
jcallahan1 | 2:ae1bfb236387 | 19 | * Constructor for the IMU |
jcallahan1 | 2:ae1bfb236387 | 20 | */ |
simplyellow | 4:ab08a70e0d7d | 21 | IMU(); |
jcallahan1 | 2:ae1bfb236387 | 22 | /** |
jcallahan1 | 2:ae1bfb236387 | 23 | * Track the angle of the truck bed |
jcallahan1 | 2:ae1bfb236387 | 24 | */ |
jcallahan1 | 2:ae1bfb236387 | 25 | void trackBed(); |
jcallahan1 | 2:ae1bfb236387 | 26 | /** |
jcallahan1 | 2:ae1bfb236387 | 27 | * Track the angle of the truck as it moves |
jcallahan1 | 2:ae1bfb236387 | 28 | */ |
jcallahan1 | 2:ae1bfb236387 | 29 | void trackHeading(); |
simplyellow | 4:ab08a70e0d7d | 30 | |
jcallahan1 | 2:ae1bfb236387 | 31 | private: |
simplyellow | 4:ab08a70e0d7d | 32 | LSM9DS1 *I; |
jcallahan1 | 2:ae1bfb236387 | 33 | bool state; |
jcallahan1 | 2:ae1bfb236387 | 34 | float ax01; |
jcallahan1 | 2:ae1bfb236387 | 35 | float ay01; |
jcallahan1 | 2:ae1bfb236387 | 36 | float az01; |
jcallahan1 | 2:ae1bfb236387 | 37 | float ax0; |
jcallahan1 | 2:ae1bfb236387 | 38 | float ay0; |
simplyellow | 4:ab08a70e0d7d | 39 | float az0; |
jcallahan1 | 2:ae1bfb236387 | 40 | float ax; |
jcallahan1 | 2:ae1bfb236387 | 41 | float ay; |
jcallahan1 | 2:ae1bfb236387 | 42 | float az; |
jcallahan1 | 2:ae1bfb236387 | 43 | float theta; |
jcallahan1 | 2:ae1bfb236387 | 44 | }; |
jcallahan1 | 2:ae1bfb236387 | 45 | |
jcallahan1 | 2:ae1bfb236387 | 46 | #endif |