8 years, 1 month ago.

Read data from ADXL345 acceleration sensor

Hello forum,

i currently try to read acceleration data from an ADXL345 sensor. I set the sensor to '16G' - range and 'full-res'. Because of that each unit should represent 4mG.

So this is my code which is responsible for the data read:

http://pastebin.com/0yk19aJb

If the sensor is placed horizontally i get these values:

X: 0 Y: 0 Z: 9658

I think this can't be correct. If i expect this to be mG it would be9.7G! Where is my mistake?

Be the first to answer this question.