![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Port of Adafruit Arduino code
Fork of Adafruit9-DOf by
Header/Adafruit_9DOF.h@1:37a7df50e330, 2016-03-24 (annotated)
- Committer:
- ivo_david_michelle
- Date:
- Thu Mar 24 22:02:43 2016 +0000
- Revision:
- 1:37a7df50e330
- Parent:
- 0:772bf4786416
copied main code, but values not changing
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 |