You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 23, 2020. It is now read-only.
In the file flowi2chelper.cpp is some waiting with available() and delay(), that can be removed.
After Wire.requestFrom() returns, there is no need to wait for something. The I2C transmission has finished and the received data is in the buffer. The Wire.available() only returns the number of bytes in the receive buffer (a buffer inside the Wire library).
It is possible to check the return value of Wire.requestFrom() or use Wire.available() to check if the right amount of data was returns, because with a multi-master bus and collisions, they might return 0 bytes.
int n = Wire.requestFrom(i2cAddress, dataLength);
if ( n != dataLength)
return( false);
Wire.readBytes(data, n);
return( true);
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
In the file flowi2chelper.cpp is some waiting with available() and delay(), that can be removed.
After Wire.requestFrom() returns, there is no need to wait for something. The I2C transmission has finished and the received data is in the buffer. The Wire.available() only returns the number of bytes in the receive buffer (a buffer inside the Wire library).
It is possible to check the return value of Wire.requestFrom() or use Wire.available() to check if the right amount of data was returns, because with a multi-master bus and collisions, they might return 0 bytes.
The text was updated successfully, but these errors were encountered: