Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I2C MPU6050 example does not provide correct intiliazation of the device #557

Open
sa2kaa opened this issue Sep 29, 2024 · 1 comment
Open

Comments

@sa2kaa
Copy link

sa2kaa commented Sep 29, 2024

Writing 80h to PWR_MGMT_1 register results in the MPU to restart in sleep mode. Instead 00h shall be written.

As shown below:

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, 0x80};
    uint8_t buf[] = {0x6B, 0x00}; // Clear the SLEEP bit, do not(!) RESET the device.
      i2c_write_blocking(i2c_default, addr, buf, 2, false);
}
@lurch
Copy link
Contributor

lurch commented Oct 2, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants