Open Koepel opened 6 years ago
Hi, Koepel.
Thank you for your reminders about this issue with our libraries.
The files you mention are copied versions of our libraries. You raised this issue with the source libraries:
https://github.com/pololu/l3g-arduino/issues/12 https://github.com/pololu/lsm303-arduino/issues/10
I'll leave this open until we fix the issue in those libraries and copy them to this one.
Sincerely, Ryan
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: