MPU6050 simple library
Dependents: MPU6050_test Drone MPU6050_test acelerometro ... more
Diff: MPU6050.h
- Revision:
- 13:e0e64e818d05
- Parent:
- 12:b8a396aa0a50
- Child:
- 14:a993e922395d
diff -r b8a396aa0a50 -r e0e64e818d05 MPU6050.h --- a/MPU6050.h Thu Aug 15 03:34:16 2019 +0000 +++ b/MPU6050.h Thu Aug 15 03:39:41 2019 +0000 @@ -118,7 +118,7 @@ * * MCP6050 is a 6-axis I2C sensor * -*@code +* @code * #include "mbed.h" * #include "MPU6050.h" * @@ -143,7 +143,8 @@ * wait(0.1); * } * } -*@endcode +* +* @endcode */ class MPU6050 { @@ -158,22 +159,28 @@ /** Init MCP6050 * + * Disable sleep mode + * Set gyro range as +- 1000 deg/s + * Set accel range as +- 4G + * Set sample rate as 470 Hz */ void start(void); /**Get WHO_AM_I * - *@return 0x68 + * return 0x68 */ char getID(void); /**Get data in float * + * The unit is G or deg/s */ bool read(float *gx, float *gy, float *gz,float *ax, float *ay, float *az); /**Get data in int * + *return as 16bit value */ bool readraw(int *gx, int *gy, int *gz,int *ax, int *ay, int *az);