-
Notifications
You must be signed in to change notification settings - Fork 16
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
No need to wait after Wire.requestFrom() and no Wire.beginTransmission() or endTransmission() should be used with Wire.requestFrom(). #1
Comments
This was referenced Nov 10, 2017
spirituallyinsane
added a commit
to spirituallyinsane/Arduino-INA219
that referenced
this issue
Dec 6, 2017
Corrected bus voltage to read out an unsigned value (See Issue jarzebski#2), and applied changes recommended by Koepel in Issue jarzebski#1
fixed in master |
Please remove this line:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When the Wire.requestFrom() returns, the I2C transaction has completely finished and the received data is waiting in a buffer in the Wire library. There is nothing to wait for after the Wire.requestFrom(). The Wire.available() and Wire.read() only use that buffer, they are not involved in the I2C bus transaction.
The while-loop to wait for something can be removed.
The Wire.beginTransmission() and Wire.endTransmission() are only used when writing data. They should not be used with Wire.requestFrom().
The text was updated successfully, but these errors were encountered: