The MPU-6050 devices combine a 3-axis gyroscope and a 3-axis accelerometer on the same silicon die, together with an onboard Digital Motion Processor™ (DMP™), which processes complex 6-axis Motion Fusion algorithms.

MPU6050_initialize

Prototype void MPU6050_initialize()
Input Arguments None
Return Value None
Description Initializes the sensor
Example Usage MPU6050_initialize();

 

MPU6050_collectdata

Prototype uint16_t MPU6050_collectdata()
Input Arguments None
Return Value sensor values
Description Collects the accelerometer and gyrometer reads from the sensor
Example Usage MPU6050_collectdata();

 

MPU6050_setFullScaleAccelRange

Prototype uint16_t MPU6050_setFullScaleAccelRange(uint8_t range)
Input Arguments uint8_t range : range of the accelerometer to set
Return Value

status :   0    -    Success

              <0   -    Failure

Description Sets the Full scale Accelerometer range
Example Usage MPU6050_setFullScaleAccelRange(MPU6050_ACCEL_FS_2);

 

MPU6050_setFullScaleGyroRange

Prototype uint16_t MPU6050_setFullScaleGyroRange(uint8_t range)
Input Arguments uint8_t range : range of the gyrometer to set
Return Value

status :   0    -    Success

              <0   -    Failure

Description Sets the Full scale Gyrometer range
Example Usage MPU6050_setFullScaleGyroRange(MPU6050_GYRO_FS_1000);

 

MPU6050_newValues

Prototype

uint16_t MPU6050_newValues(int16_t ax, int16_t ay, int16_t az, int16_t gx, int16_t gy, int16_t gz)

Input Arguments

ax,ay,az ----> buffer to store accelerometer values

gx,gy,gz ----> buffer to store gyrometer values

Return Value None
Description Reads the 6-axis sensor values
Example Usage MPU6050_newValues(&temp[0], &temp[1], &temp[2], &gyro[0], &gyro[1], &gyro[2]);

 

MPU6050_getMotion6

Prototype void MPU6050_getMotion6(int16_t* ax, int16_t* ay, int16_t* az, int16_t* gx, int16_t* gy, int16_t* gz)
Input Arguments

ax,ay,az ----> buffer to store accelerometer values

gx,gy,gz ----> buffer to store gyrometer values

Return Value None
Description Reads the accelerometer and gyrometer values
Example Usage MPU6050_getMotion6(&temp[0], &temp[1], &temp[2], &gyro[0], &gyro[1], &gyro[2]);

 

MPU6050_setI2CBypassEnabled

Prototype uint8_t MPU6050_setI2CBypassEnabled(uint8_t enabled)
Input Arguments uint8_t enable: 1
Return Value

status :    0   -    Success

              <0   -    Failure

Description

Set the i2c bypass as enable

Example Usage MPU6050_setI2CBypassEnabled(1);

 

MPU6050_setI2CMasterModeEnabled

Prototype uint8_t MPU6050_setI2CMasterModeEnabled(uint8_t enabled)
Input Arguments uint8_t enable: 1
Return Value

status :    0   -    Success

              <0   -    Failure

Description

Enables the i2c master mode

Example Usage MPU6050_setI2CMasterModeEnabled(1);

 

MPU6050_setSleepEnabled

 

Prototype uint8_t MPU6050_setSleepEnabled(uint8_t enabled)
Input Arguments uint8_t enable: 1
Return Value

status :    0   -    Success

              <0   -    Failure

Description

Enables the  sensor sleep bit

Example Usage MPU6050_setSleepEnabled(1);

 

MPU6050_setClockSource

Prototype

uint16_t MPU6050_setClockSource(uint8_t source)

Input Arguments uint16_t Source: Clock Source to set
Return Value None
Description

Sets the clock source for the sensor

Example Usage MPU6050_setClockSource(MPU6050_CLOCK_PLL_XGYRO);