Skip to main content
Visitor 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.

    This topic has been closed for replies.
    Best answer by Federica Bossi

    Hi @bennanbei ,

    So everything works fine now, right?

    1 reply

    bennanbeiAuthor
    Visitor 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

    Technical Moderator
    March 26, 2024

    Hi @bennanbei ,

    So everything works fine now, right?

    bennanbeiAuthor
    Visitor II
    March 26, 2024

    yes