Skip to content

Commit a310477

Browse files
committed
Merge master into develop
2 parents 489f729 + 130987d commit a310477

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

i2c/mpu6050_i2c/mpu6050_i2c.c

+6
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ static void mpu6050_reset() {
3939
// There are a load more options to set up the device in different ways that could be added here
4040
uint8_t buf[] = {0x6B, 0x80};
4141
i2c_write_blocking(i2c_default, addr, buf, 2, false);
42+
sleep_ms(100); // Allow device to reset and stabilize
43+
44+
// Clear sleep mode (0x6B register, 0x00 value)
45+
buf[1] = 0x00; // Clear sleep mode by writing 0x00 to the 0x6B register
46+
i2c_write_blocking(i2c_default, addr, buf, 2, false);
47+
sleep_ms(10); // Allow stabilization after waking up
4248
}
4349

4450
static void mpu6050_read_raw(int16_t accel[3], int16_t gyro[3], int16_t *temp) {

0 commit comments

Comments
 (0)