Skip to main content
bennanbei
Associate II
March 25, 2024
Solved

LIS2DH12

  • March 25, 2024
  • 1 reply
  • 1564 views

Guys, I ran into a strange problem while debugging LIS2DH12, someone help me.

I configured the high-precision mode, using 12 bits, with a range of +-4g, that is, when I placed the table (the chip with the sign facing up, the positive direction described in the instructions) it should have been subject to neutral acceleration and the converted value should have been -1g, but the result I got was +1g, I verified the other two axes, The resulting acceleration value is the opposite of the direction indicated in the manual, that is, when I always accelerate in the opposite direction of each axis, the resulting conversion value is indeed positive

bennanbei_0-1711373762150.pngbennanbei_1-1711373806843.pngbennanbei_2-1711373822879.png

bennanbei_3-1711373830515.png

 

Moreover, I read out the register value directly using lis2dh12_from_fs4_hr_to_mg function for conversion, and the size is close to 1g, but its direction is reverse, at this time I am the chip marked up, the acceleration value should be gravity acceleration downward is negative, it is positive.

Best answer by Federica Bossi

Hi @bennanbei ,

So everything works fine now, right?

1 reply

bennanbei
bennanbeiAuthor
Associate II
March 26, 2024

I see. It's the accelerometer and the direction of acceleration. I didn't get it. I should have looked at how the accelerometer works

Federica Bossi
Federica BossiBest answer
Technical Moderator
March 26, 2024

Hi @bennanbei ,

So everything works fine now, right?

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
bennanbei
bennanbeiAuthor
Associate II
March 26, 2024

yes