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:
akhodeir
2023-02-10 16:40:01 +01:00
committed by GitHub
parent 92de98a364
commit 42ffd518c9

View File

@@ -37,7 +37,7 @@ static int addr = 0x68;
static void mpu6050_reset() { static void mpu6050_reset() {
// Two byte reset. First byte register, second byte data // 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 // 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); i2c_write_blocking(i2c_default, addr, buf, 2, false);
} }