Jatin Sharma
/
RaheeNew
RaheeNew
Fork of Adafruit9-DOf by
Header/Adafruit_9DOF.h@0:772bf4786416, 2015-03-21 (annotated)
- Committer:
- bmanga95
- Date:
- Sat Mar 21 12:33:05 2015 +0000
- Revision:
- 0:772bf4786416
First version
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bmanga95 | 0:772bf4786416 | 1 | /*************************************************************************** |
bmanga95 | 0:772bf4786416 | 2 | This is a library for the Adafruit 9DOF Breakout |
bmanga95 | 0:772bf4786416 | 3 | |
bmanga95 | 0:772bf4786416 | 4 | Designed specifically to work with the Adafruit 9DOF Breakout: |
bmanga95 | 0:772bf4786416 | 5 | http://www.adafruit.com/products/1714 |
bmanga95 | 0:772bf4786416 | 6 | |
bmanga95 | 0:772bf4786416 | 7 | These displays use I2C to communicate, 2 pins are required to interface. |
bmanga95 | 0:772bf4786416 | 8 | |
bmanga95 | 0:772bf4786416 | 9 | Adafruit invests time and resources providing this open source code, |
bmanga95 | 0:772bf4786416 | 10 | please support Adafruit andopen-source hardware by purchasing products |
bmanga95 | 0:772bf4786416 | 11 | from Adafruit! |
bmanga95 | 0:772bf4786416 | 12 | |
bmanga95 | 0:772bf4786416 | 13 | Written by Kevin Townsend for Adafruit Industries. |
bmanga95 | 0:772bf4786416 | 14 | BSD license, all text above must be included in any redistribution |
bmanga95 | 0:772bf4786416 | 15 | ***************************************************************************/ |
bmanga95 | 0:772bf4786416 | 16 | #ifndef __ADAFRUIT_9DOF_H__ |
bmanga95 | 0:772bf4786416 | 17 | #define __ADAFRUIT_9DOF_H__ |
bmanga95 | 0:772bf4786416 | 18 | |
bmanga95 | 0:772bf4786416 | 19 | #include <Adafruit_Sensor.h> |
bmanga95 | 0:772bf4786416 | 20 | #include <Adafruit_LSM303_U.h> |
bmanga95 | 0:772bf4786416 | 21 | #include <Adafruit_L3GD20_U.h> |
bmanga95 | 0:772bf4786416 | 22 | |
bmanga95 | 0:772bf4786416 | 23 | |
bmanga95 | 0:772bf4786416 | 24 | /** Sensor axis */ |
bmanga95 | 0:772bf4786416 | 25 | typedef enum |
bmanga95 | 0:772bf4786416 | 26 | { |
bmanga95 | 0:772bf4786416 | 27 | SENSOR_AXIS_X = (1), |
bmanga95 | 0:772bf4786416 | 28 | SENSOR_AXIS_Y = (2), |
bmanga95 | 0:772bf4786416 | 29 | SENSOR_AXIS_Z = (3) |
bmanga95 | 0:772bf4786416 | 30 | } sensors_axis_t; |
bmanga95 | 0:772bf4786416 | 31 | |
bmanga95 | 0:772bf4786416 | 32 | /* Driver for the the 9DOF breakout sensors */ |
bmanga95 | 0:772bf4786416 | 33 | class Adafruit_9DOF |
bmanga95 | 0:772bf4786416 | 34 | { |
bmanga95 | 0:772bf4786416 | 35 | public: |
bmanga95 | 0:772bf4786416 | 36 | Adafruit_9DOF(void); |
bmanga95 | 0:772bf4786416 | 37 | bool begin(void); |
bmanga95 | 0:772bf4786416 | 38 | |
bmanga95 | 0:772bf4786416 | 39 | bool accelGetOrientation ( sensors_event_t *event, sensors_vec_t *orientation ); |
bmanga95 | 0:772bf4786416 | 40 | bool magTiltCompensation ( sensors_axis_t axis, sensors_event_t *mag_event, sensors_event_t *accel_event ); |
bmanga95 | 0:772bf4786416 | 41 | bool magGetOrientation ( sensors_axis_t axis, sensors_event_t *event, sensors_vec_t *mag_orientation ); |
bmanga95 | 0:772bf4786416 | 42 | bool fusionGetOrientation ( sensors_event_t *accel_event, sensors_event_t *mag_event, sensors_vec_t *orientation ); |
bmanga95 | 0:772bf4786416 | 43 | |
bmanga95 | 0:772bf4786416 | 44 | private: |
bmanga95 | 0:772bf4786416 | 45 | }; |
bmanga95 | 0:772bf4786416 | 46 | |
bmanga95 | 0:772bf4786416 | 47 | #endif |