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
In the files "LSM303.cpp" and "L3G.cpp" there is sometimes a Wire.endTransmission() after the Wire.requestFrom(). That Wire.endTransmission() can be removed, it should only be used when writing data.
The waiting or a timeout after a Wire.requestFrom() can be removed as well. When the Wire.requestFrom() returns, the I2C transaction on the bus has already completely finished and the received data is waiting in a buffer in the Wire library. If something did go wrong on the bus, the number of received bytes might be not the same as the number of requested bytes.
This:
Wire.requestFrom(address, (byte)6);
unsigned int millis_start = millis();
while (Wire.available() < 6)
{
if (io_timeout > 0 && ((unsigned int)millis() - millis_start) > io_timeout)
{
did_timeout = true;
return;
}
}
could be replaced with this:
Wire.requestFrom(address, (byte)6);
if (Wire.available() != 6)
{
set some kind of error
return;
}
The text was updated successfully, but these errors were encountered:
In the files "LSM303.cpp" and "L3G.cpp" there is sometimes a Wire.endTransmission() after the Wire.requestFrom(). That Wire.endTransmission() can be removed, it should only be used when writing data.
The waiting or a timeout after a Wire.requestFrom() can be removed as well. When the Wire.requestFrom() returns, the I2C transaction on the bus has already completely finished and the received data is waiting in a buffer in the Wire library. If something did go wrong on the bus, the number of received bytes might be not the same as the number of requested bytes.
This:
could be replaced with this:
The text was updated successfully, but these errors were encountered: