sparkfun / SparkFun_ADXL345_Arduino_Library

Arduino Library for the ADXL345
46 stars 52 forks source link

Compatibility with 32 bit boards #4

Closed PaulStoffregen closed 7 years ago

PaulStoffregen commented 7 years ago

This library currently only works on 8 bit AVR, due to an assumption that signed int is 16 bits. On 32 bit boards, negative acceleration reads as large positive numbers.

This pull request just adds a cast to int16_t, to allow 32 bit processors to get the same result.

elizabethsrobert commented 7 years ago

@PaulStoffregen - Thank you for the contribution!