2024-02-06 05:25 AM
Hi,
I am using examples from the github repo to test accelerometer. I can read device id from both accel and magnetometer. Also I can read back the registers I set. However, when it comes to read accelerometer, I read same values from all axis of the accelerometer such as A0A0A0 or 808080 and so on. Another behavior I observed is sometimes, boot register stuck as 1 after I use to BOOT bit from CTRL_REG5_A.
Also I read very low values from magnetometer and 0 from temperature sensor.
Is there any idea what is going wrong?
Thanks.
Solved! Go to Solution.
2024-02-07 06:43 AM
Hi @Federica Bossi ,
I think problem is the auto address incrementation for the multiple reads. Because when I've read the axis out registers one by one, I can see correct values. Also when I changed to LSM303AGR_OUT_X_L_A (0x28) to 0xA8, library function (lsm303agr_temperature_raw_get) also gives correct outcomes
Thanks,
Selim.
2024-02-07 06:14 AM
Hi @Selim Sagir ,
Have you made any changes to the examples on github or are you using them as they are loaded?
2024-02-07 06:43 AM
Hi @Federica Bossi ,
I think problem is the auto address incrementation for the multiple reads. Because when I've read the axis out registers one by one, I can see correct values. Also when I changed to LSM303AGR_OUT_X_L_A (0x28) to 0xA8, library function (lsm303agr_temperature_raw_get) also gives correct outcomes
Thanks,
Selim.
2024-02-07 06:59 AM
Hi @Selim Sagir ,
Ok, so have you found how to solve this issue?
2024-02-12 05:30 AM
Yes.