Skip to content

I2C Read Issue #16

@MichiTheSailor

Description

@MichiTheSailor

Ciao,

First o fall many thanks for your good work - Make handling of MPU6050 really easy ;o)

After Updating to new version of ESP32-HAL-I2C I realized that READ from MPU6050 did not work any more. (got only NULL values)
After research and comparision with different other includes like I2C-EEPROM, I2C-Display, etc. I realized that your access seems wrong designed and worked until now only by accident.

Real Bugfix is the wrong parameter in "endTransmission", further I added e rought "error detection/handling".

Simple Bugfix in MPU6050_tockn.cpp:
Change Line 71 in MPU6050::calcGyroOffsets from:
wire->endTransmission(false)
to:
byte rxStatus = wire->endTransmission(true);
if (rxStatus != 0) Serial.println("MPU6050::update EC: " + String(rxStatus));

Same Bugfix in MPU6050_tockn.cpp:
Change Line 105 in MPU6050::update from:
wire->endTransmission(false)
to:
byte rxStatus = wire->endTransmission(true);
if (rxStatus != 0) Serial.println("MPU6050::update EC: " + String(rxStatus));

Afterwards it worked really fine.... :o)

Kind regards
Michi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions