nagimov / adxl345spi

ADXL345 three-axis accelerometer reader (SPI interface)
GNU General Public License v3.0
62 stars 23 forks source link

Changing accelerometer sensing range #14

Open ugemassolo opened 10 months ago

ugemassolo commented 10 months ago

Hi, I am looking for help to change the sensing range of the sensor. I would like to know what I should change for it to work correctly, since from what I understand, not only do you have to change the scaling factor but also the DATA_FORMAT. Thanks!

nagimov commented 10 months ago

DATA_FORMAT is a register address (0x31) and should stay unchanged. DATA_FORMAT_B defines the measurement range and some other data formatting params: adxl_data_format You'll also need to update the accConversion accordingly. Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ADXL345.pdf