Hey there, I am currently trying to read some acceleration data with the LSM303AGR via SPI.
In order to do so, I have already set up the SPI and accelerometer and I have accomplished to read
the who_am_i register successfully. But there is something off with the values I am reading from the sensor.
It seems like I am always getting the same, lets say 5, random values, no matter how fast I twist and turn the sensor.
For example, the OUT_X_H_A (29h) always seems to be either 228 or 229. The OUT_X_L_A (28h) register on the other
hand is either 96,160, 0 or 224. It does not matter if I move the sensor. The same szenario applies to the other axes (Y and Z) too, and I cannot explain why.
I have enabled all axes.
Power-mode-selection is: HR / Normal / Low-power mode (200Hz)
LPen Bit is 0.
I have enabled 3-wire SPI
BDU Bit is 0 (I have also tested with BDU = 1 --> same result)
Fullscale = +/- 2g
I am also setting the REBOOT Bit ( to reboot the accelerometer memory content) after I have read all axes.
How can I fix this? Thank you for any help in advance!