LIS3DH accelorometer based on i2c
Hi,
we are woeking on motion detection application using LIS3DH,we have done below register
settings but we are only getting interrupt on motion first time but after that we are not getting interrupt after reset also.once we are getting th einterrupt and checking the register INT1_SRC but its value we are getting is zero.can you please suggest register setting to detect motion,do we need to give some delay after any register setting.
reg[0] = CTRL_REG1; /* 10Hz, normal power mode, ZXY enable */ reg[1] = 0x27; err_code = i2c_lis3dh_write_data(reg, 2); reg[0] = CTRL_REG2; /* HP filter for INT1 */ reg[1] = 0x01; err_code = i2c_lis3dh_write_data(reg, 2); reg[0] = CTRL_REG3; /* IA1 enable */ reg[1] = 0x40; err_code = i2c_lis3dh_write_data(reg, 2); reg[0] = CTRL_REG4; /* scale 4g */ reg[1] = 0x10; err_code = i2c_lis3dh_write_data(reg, 2); reg[0] = CTRL_REG5; /* interrupt 1 pin latched */ reg[1] = 0x08; err_code = i2c_lis3dh_write_data(reg, 2); reg[0] = CTRL_REG6; /* change interrupt polarity, active low as requested */ reg[1] = 0x02; err_code = i2c_lis3dh_write_data(reg, 2); /* 64mg threshold,0x01 can be close to noise so the interrupt would be triggered by the noise */ reg[0] = INT1_THS; reg[1] = 0x02; err_code = i2c_lis3dh_write_data(reg, 2); reg[0] = INT1_DURATION; /* 0.5s to activate interrupt */ reg[1] = 0x05; err_code = i2c_lis3dh_write_data(reg, 2); reg[0] = INT1_CFG; /* OR, X,Y,Z higher than threshold */ reg[1] = 0x2A; err_code = i2c_lis3dh_write_data(reg, 2);
