Skip to main content
Visitor II
May 9, 2017
Question

LIS3DH Accelerometer Click Detection

  • May 9, 2017
  • 1 reply
  • 1298 views
Posted on May 09, 2017 at 11:40

Hey guys, I am trying to do click detection for my LIS3DH accelerometer. For single click, what I should add inside my code? Here is my code, please help me.

void Acc__EnableClickDetect(void)

{

  LIS3DH_SetAxis(LIS3DH_X_ENABLE);

  LIS3DH_SetODR(LIS3DH_ODR_400Hz);

  LIS3DH_SetClickCFG(LIS3DH_ZD_DISABLE | LIS3DH_ZS_DISABLE | LIS3DH_YD_DISABLE | LIS3DH_YS_DISABLE |      LIS3DH_XD_DISABLE |LIS3DH_XS_ENABLE);

 

}

Do I need to add Latency, Limit and Window inside the code? I tried to add it but when I call LIS3DH_SetClickLatency(200) inside the function, there was a warning Implicit declaration something like that.

    This topic has been closed for replies.

    1 reply

    ST Employee
    May 10, 2017
    Posted on May 10, 2017 at 15:37

    Please read the chapter 7 'Click and double-click recognition' in the application note

    http://www.st.com/resource/en/application_note/cd00290365.pdf

    .
    Visitor II
    May 11, 2017
    Posted on May 11, 2017 at 02:20

    Thanks!!! I will.