sparkfun / SparkFun_ADXL345_Arduino_Library

Arduino Library for the ADXL345
46 stars 52 forks source link

g calculation correct for 2g range but wrong for other ranges #6

Open mgrusin opened 7 years ago

mgrusin commented 7 years ago

The floating point gains built into the library are handy, but are correct only for the 2g range; you'll get erroneous results when using the .get_Gxyz() function and a range other than 2. A solution in .get_Gxyz() would be to multiply each result by (range/2), e.g. 8 for the 16g range.

ToniCorinne commented 7 years ago

Want to set up a pull request @mgrusin ?

mgrusin commented 7 years ago

You mean if I find a bug I have to fix it!? This changes everything.

Coming right up.