lis3mdl-arduino
lis3mdl-arduino copied to clipboard
There should be no Wire.endTransmission() after the Wire.requestFrom() and no timeout.
A Wire.endTransmission is only needed when writing data, it should not be used with Wire.requestFrom().
There is no need for a timeout after Wire.requestFrom(). When the Wire.requestFrom() returns, the complete I2C transmission has already finished, and the received data is waiting in the receive buffer inside the Wire library.