cancel
Showing results for 
Search instead for 
Did you mean: 

LIS3DH Accelerometer Click Detection

Donald Chen
Associate II
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.

3 REPLIES 3
Miroslav BATEK
ST Employee
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

.
Posted on May 11, 2017 at 02:20

Thanks!!! I will.

Posted on May 11, 2017 at 06:07

Sorry, how to check if my click is detected ?