4724 views|10 replies

19

Posts

0

Resources
The OP
 

How to configure LSM6DS3TR-C single and double click at the same time [Copy link]

 

Application scenario: For example, TWS single-click the next song; double-click the previous song.

After SINGLE_DOUBLE_TAP is set to 1, theoretically both single and double tap detection are enabled at the same time. Then go to the event register TAP_SRC (see the figure below), no matter how you tap, SINGLE_TAP will not be set to 1; DOUBLE_TAP will be set to 1 after detecting a double tap.

Why is SINGLE_TAP not set to 1: Doesn't it mean that when SINGLE_DOUBLE_TAP is set to 1, both single and double-click detection are enabled at the same time? Then for the corresponding single-click event, SINGLE_TAP should be set to 1.

I don’t know if my understanding is wrong.

Or do you have better ideas for using single and double click at the same time? Thank you

This post is from MEMS sensors

Latest reply

I don't have this sensor and can't help you test it. If it still doesn't work, can you use the single-click mode and then use the MCU to detect the double-click event through the software timer to achieve the function you want?   Details Published on 2020-12-30 14:00
 
 

9702

Posts

24

Resources
2
 
This post was last edited by littleshrimp on 2020-12-18 20:34

Try binding the single and double click events to the INT1 pin and look at the waveform.

This post is from MEMS sensors
Personal signature虾扯蛋,蛋扯虾,虾扯蛋扯虾
 
 
 

1w

Posts

142

Resources
3
 

The single-click and double-click detection mechanisms will not set the single-click register when a double-click event occurs, so that control is not messed up.

The general judgment mechanism: when the edge arrives, the debounce judgment is valid. There is a silent period after the pulse. If there is no next pulse after the silent period, it is judged as a single click. When the next pulse appears, it is judged whether it meets the double-click feature. The result is either a single click or a double click. There is no situation where the single click register also responds after a double click. The short triple click depends on the designer's intention, whether it is judged as invalid or a double click, or a double click followed by a single click.

This post is from MEMS sensors
Personal signature上传了一些书籍资料,也许有你想要的:http://download.eeworld.com.cn/user/chunyang
 
 
 

9702

Posts

24

Resources
4
 

LSM6DSO also supports single and double click

I used the official code to test it and it works.

You can watch this video

VID_20201219_100822.mp4 (5.44 MB, downloads: 153)

Below is the official code for testing single and double click of LSM6DSO. See if you can refer to it.

lsm6dso_reg.c (235.24 KB, downloads: 22)

lsm6dso_reg.h (93.81 KB, downloads: 17)

single_double_tap.c (10.04 KB, downloads: 33)

This post is from MEMS sensors

Comments

I tried it according to your configuration, but it still doesn't work. It seems that single and double clicks occur at the same time. [attachimg]518824[/attachimg]  Details Published on 2020-12-25 16:59
Personal signature虾扯蛋,蛋扯虾,虾扯蛋扯虾
 
 
 

19

Posts

0

Resources
5
 
littleshrimp posted on 2020-12-19 10:17 LSM6DSO also supports single click and double click. I used the official code to test it. The function can be realized. You can watch this video...

I tried it according to your configuration, but it still doesn't work. It seems that single and double clicks occur at the same time.

This post is from MEMS sensors

Comments

You are in double-click mode, does it appear on both single and double clicks?  Details Published on 2020-12-28 13:20
You are in double-click mode, does it appear on both single and double clicks?  Details Published on 2020-12-28 13:19
 
 
 

9702

Posts

24

Resources
6
 
Fly666 posted on 2020-12-25 16:59 I tried it according to your configuration, but it still doesn't work. It looks like single and double clicks appear at the same time.

You are in double-click mode, does it appear on both single and double clicks?

This post is from MEMS sensors

Comments

Yes, it is actually the double-click routine in the application manual, but the single-click interrupt is added to see whether the single-click interrupt will appear. It is actually present in the test. And after the single-click interrupt is turned on, the double-click interrupt is basically difficult to generate.  Details Published on 2020-12-30 13:36
Personal signature虾扯蛋,蛋扯虾,虾扯蛋扯虾
 
 
 

9702

Posts

24

Resources
7
 
Fly666 posted on 2020-12-25 16:59 I tried it according to your configuration, but it still doesn't work. It looks like single and double clicks appear at the same time.

This post is from MEMS sensors

Comments

Is this just a double click? Try turning on the single click interrupt as well?  Details Published on 2020-12-30 13:37
Personal signature虾扯蛋,蛋扯虾,虾扯蛋扯虾
 
 
 

19

Posts

0

Resources
8
 
littleshrimp posted on 2020-12-28 13:19 Is this in double-click mode? Does it appear for both single and double clicks?

Yes, it is actually the double-click routine in the application manual, but the single-click interrupt is added to see whether the single-click interrupt will appear. It is actually present in the test. And after the single-click interrupt is turned on, the double-click interrupt is basically difficult to generate.

This post is from MEMS sensors

Comments

I don't have this sensor and can't help you test it. If it still doesn't work, can you use the single-click mode and then use the MCU to detect the double-click event through the software timer to achieve the function you want?  Details Published on 2020-12-30 14:00
 
 
 

19

Posts

0

Resources
9
 

Is this just a double click? Try turning on the interrupt for single click as well?

This post is from MEMS sensors
 
 
 

9702

Posts

24

Resources
10
 
Fly666 posted on 2020-12-30 13:36 Yes, it is actually the double-click routine in the application manual, but add the single-click interrupt to see whether the single-click interrupt will appear. The actual test shows that it will...

I don't have this sensor and can't help you test it. If it still doesn't work, can you use the single-click mode and then use the MCU to detect the double-click event through the software timer to achieve the function you want?

This post is from MEMS sensors

Comments

This is indeed a good method.  Details Published on 2020-12-30 14:13
Personal signature虾扯蛋,蛋扯虾,虾扯蛋扯虾
 
 
 

19

Posts

0

Resources
11
 
littleshrimp posted on 2020-12-30 14:00 I don't have this sensor and can't help you test it. If it still doesn't work, use the single-click mode, and then the MCU can detect the double-click event through the software timer...

This is indeed a good method.

This post is from MEMS sensors
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list