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 Read Issue #16

Open
MichiTheSailor opened this issue Dec 22, 2018 · 4 comments
Open

I2C Read Issue #16

MichiTheSailor opened this issue Dec 22, 2018 · 4 comments

Comments

@MichiTheSailor
Copy link

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

@cedricwritescode
Copy link

This fix worked also fine for me on my ESP32 DOIT Devkit V1.
The Serial.print didn't worked for me. Without it it works.

@geoInno
Copy link

geoInno commented Jan 8, 2019

Works well, but my GY-521 board is powered with 5V and gives an output of 3.6 V on SDA/SLA. This is not working with my ESP32 devkit board, even though I2C scan shows the address of the module. Quick solution is to add a 10K resistor between each line (SDA/SDL) and GROUND. Have fun. Damian

@agunes77
Copy link

thank you Damian

ystark pushed a commit to ystark/MPU6050_tockn that referenced this issue Aug 29, 2019
@netpipe
Copy link

netpipe commented Nov 20, 2021

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

5 participants