MPU6050 simple library
Dependents: MPU6050_test Drone MPU6050_test acelerometro ... more
Diff: MPU6050.h
- Revision:
- 6:37d0473b0bf4
- Parent:
- 5:7bffa28ee936
- Child:
- 7:f80a0baa6866
--- a/MPU6050.h Thu Aug 15 03:06:09 2019 +0000 +++ b/MPU6050.h Thu Aug 15 03:12:09 2019 +0000 @@ -121,28 +121,29 @@ class MPU6050 { public: - MPU6050(PinName sda, PinName scl); + /** Create a MPU6050 Instance *@param sda SDA pinname of I2C *@param scl SCL piname of I2C */ - - void start(void); + MPU6050(PinName sda, PinName scl); + /** Init MCP6050 */ - - char getID(void); + void start(void); + /**Get WHO_AM_I */ - + char getID(void); + + /**Get WHO_AM_I + */ bool read(float *gx, float *gy, float *gz,float *ax, float *ay, float *az); - /**Get data in float - */ - - bool readraw(int *gx, int *gy, int *gz,int *ax, int *ay, int *az); + /**Get data in int */ - + bool readraw(int *gx, int *gy, int *gz,int *ax, int *ay, int *az); + private: I2C _MPU6050; float gx, gy, gz,ax,ay,az;