AnsweredAssumed Answered

IIS2DH Activity/Inactivity threshold setting

Question asked by Arpan Patel on Jan 20, 2018
Latest reply on Jan 30, 2018 by Arpan Patel

Hi, I have configured accelerometer's registers as follows. So, from the activity threshold value how I know that at which raw value of X, Y, and Z axis it will be interrupted on a specific pin?

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

response = LIS3DH_SetODR(LIS3DH_ODR_10Hz);
if(response==1){
print("SET_ODR_OK\r\n");
}
response = LIS3DH_SetMode(LIS3DH_LOW_POWER);
if(response==1){
print("SET_MODE_OK\r\n");
}
response = LIS3DH_SetFullScale(LIS3DH_FULLSCALE_2);
if(response==1){
print("SET_FULLSCALE_OK\r\n");
}
response = LIS3DH_SetAxis(LIS3DH_X_ENABLE | LIS3DH_Y_ENABLE | LIS3DH_Z_ENABLE);
if(response==1){
print("SET_AXIS_OK\r\n");
}
response = LIS3DH_SetFilterDataSel(MEMS_ENABLE);
if(response==1){
print("Filter Data Selection enable\r\n");
}
response = LIS3DH_SetInt2Pin(LIS3DH_INT_ACTIVITY_ENABLE|LIS3DH_INT_ACTIVE_LOW);
if(response==1){
print("ACTIVITY enable\r\n");
}
response = LIS3DH_SetInt2Configuration(LIS3DH_INT2_OR|LIS3DH_INT2_ZHIE_ENABLE|LIS3DH_INT2_ZLIE_ENABLE|LIS3DH_INT2_YLIE_ENABLE|LIS3DH_INT2_YHIE_ENABLE|LIS3DH_INT2_XLIE_ENABLE|LIS3DH_INT2_XHIE_ENABLE);
if(response==1){
print("INT2 configuration\r\n");
}
response = LIS3DH_ActThreshold(0x08);
if(response==1){
print("ACTIVITY threshold set\r\n");
}
response = LIS3DH_SetActDuration(0x0a);
if(response==1){
print("ACTIVITY duration set\r\n");
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

I have set 0X08 into act threshold register so at which raw data on X,Y,Z axis I will get interrupt. Moreover, I have also disable two axis and tried to getting interrupt only on specific axis but the it will not working properly. So, could you help me to do this? Thanks.

Outcomes