Skip to content

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

Closed
@sa2kaa

Description

@sa2kaa

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);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions