Skip to content

Commit

Permalink
Merge master into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
kilograham committed Nov 25, 2024
2 parents 489f729 + 130987d commit a310477
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions i2c/mpu6050_i2c/mpu6050_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ static void mpu6050_reset() {
// There are a load more options to set up the device in different ways that could be added here
uint8_t buf[] = {0x6B, 0x80};
i2c_write_blocking(i2c_default, addr, buf, 2, false);
sleep_ms(100); // Allow device to reset and stabilize

// Clear sleep mode (0x6B register, 0x00 value)
buf[1] = 0x00; // Clear sleep mode by writing 0x00 to the 0x6B register
i2c_write_blocking(i2c_default, addr, buf, 2, false);
sleep_ms(10); // Allow stabilization after waking up
}

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

0 comments on commit a310477

Please sign in to comment.