-
Notifications
You must be signed in to change notification settings - Fork 1
MPU 6050
The device powers up in the sleep state, so you have to clear bit 6 of register 0x6B. In the example arduino code, clearing the whole register works well enough.
The device supports low pass filtering of the output, referred to as "digital low pass filter" (DLPF) in the register map documentation. 0x1A CONFIG bits 2:0 of the CONFIG register set the low pass filter (LPF) bandwidth.
There is an pin on the MPU6050 that can be set to go high under certain conditions, one of which is DATA_RDY. This will allow us to ensure that when we read the acceleration data and gyroscope data, that they will all be from the same sample.
0x38 INT_ENABLE -- set to 0x01 to enable the DATA_RDY interrupt
May need to set some other bits to enable the interrupt #Reading from the device
The acceleration data is 16 bits spread across two registers.
0x3B ACCEL_XOUT_H
0x3C ACCEL_XOUT_L
0x3D ACCEL_YOUT_H
0x3E ACCEL_YOUT_L
0x3F ACCEL_ZOUT_H
0x40 ACCEL_ZOUT_L
The gyroscope data is 16 bits spread across two registers.
0x43 GYRO_XOUT_H
0x44 GYRO_XOUT_L
0x45 GYRO_YOUT_H
0x46 GYRO_YOUT_L
0x47 GYRO_ZOUT_H
0x48 GYRO_ZOUT_L