fix device reset in mpu6050_i2c.c (#319)
To reset the MPU6050, the device_reset bit shall be set to '1'. reference from "MPU-6000/MPU-6050 Register Map and Descriptions" DEVICE_RESET : When set to 1, this bit resets all internal registers to their default values. The bit automatically clears to 0 once the reset is done.
This commit is contained in:
@@ -37,7 +37,7 @@ static int addr = 0x68;
|
||||
static void mpu6050_reset() {
|
||||
// Two byte reset. First byte register, second byte data
|
||||
// There are a load more options to set up the device in different ways that could be added here
|
||||
uint8_t buf[] = {0x6B, 0x00};
|
||||
uint8_t buf[] = {0x6B, 0x80};
|
||||
i2c_write_blocking(i2c_default, addr, buf, 2, false);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user