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
Hi, that code by loveelectronics.co.uk (it does not exist anymore) has sadly a bug.
The Wire.beginTransmission() and Wire.endTransmission() should not be used with Wire.requestFrom(). They are only used when writing data.
In the file "arduino/libraries/love_ADXL345/love_ADXL345.cpp" in the function Read(), those are used around the Wire.requestFrom(), those Wire.beginTransmission() and Wire.endTransmission() can be removed.
In the function Read(), the buffer is created on the stack, and a pointer to that buffer is returned. That is a bug. The scope of that buffer is only inside the function. As soon as the function returns, that buffer is no longer valid.
The text was updated successfully, but these errors were encountered:
Hi, that code by loveelectronics.co.uk (it does not exist anymore) has sadly a bug.
The Wire.beginTransmission() and Wire.endTransmission() should not be used with Wire.requestFrom(). They are only used when writing data.
In the file "arduino/libraries/love_ADXL345/love_ADXL345.cpp" in the function Read(), those are used around the Wire.requestFrom(), those Wire.beginTransmission() and Wire.endTransmission() can be removed.
In the function Read(), the buffer is created on the stack, and a pointer to that buffer is returned. That is a bug. The scope of that buffer is only inside the function. As soon as the function returns, that buffer is no longer valid.
The text was updated successfully, but these errors were encountered: