Skip to main content
Visitor II
July 19, 2017
Question

IIS2DH Double click detection (DM00171283)

  • July 19, 2017
  • 0 replies
  • 594 views
Posted on July 19, 2017 at 14:30

I have done following configuration to detect double click. I am able to detect double tap but it is consider four times.

I2C_WriteByte(&ctrl_1,1,0x5F);

I2C_WriteByte(&ctrl_3,1,0x80);

I2C_WriteByte(&ctrl_6,1,0x82);

I2C_WriteByte(&ctrl_4,1,0x20);

I2C_WriteByte(&int1_config,1,0x00);

I2C_WriteByte(&ctrl_5,1,0x40);

I2C_WriteByte(&click_config,1,0x2A);

I2C_WriteByte(&time_limit,1,0x05);

I2C_WriteByte(&click_ths,1,0x30);

I2C_WriteByte(&time_latency,1,0x05);

I2C_WriteByte(&TIME_WINDOW,1,0x80);

while(1)

{

click = I2C_ReadByte(&click_src,1);

   if((click & (1<<6)))

   {

      print('click detection');

   }

}

Is anything wrong with my configuration? How I can overcome to get multiple times to print 'click detection'? Double tap detect only on hardware but if I want detect around the hardware hoe can I get it?

    This topic has been closed for replies.