The OP
Published on 2019-2-14 14:29
Only look at the author
This post is from stm32/stm8
Latest reply
The original poster should divide this problem into two parts, one is to obtain the key status, and the other is to process according to the key status, so that the logic may be clearer. If the original poster's heavy press and light press mean long press and short press, then you can assign key1=0 first, and when it detects that the key is pressed, key1=1, delay for a period of time and then detect again. If the key is still pressed, key1=2, and finally process according to the value of key1 in the main loop. This is what I did, and I can make one key play the role of two keys.
Details
Published on 2019-2-17 09:21
| ||
|
||
2
Published on 2019-2-14 14:37
Only look at the author
This post is from stm32/stm8
| ||
|
||
|
y909334873
Currently offline
|
3
Published on 2019-2-14 14:41
Only look at the author
This post is from stm32/stm8
| |
Personal signatureHello astroturfers
|
||
|
This post is from stm32/stm8
Comments | ||
|
||
|
This post is from stm32/stm8
| ||
|
||
|
6
Published on 2019-2-14 20:27
Only look at the author
This post is from stm32/stm8
| ||
|
||
|
7
Published on 2019-2-15 00:03
Only look at the author
This post is from stm32/stm8
| ||
|
||
|
8
Published on 2019-2-15 08:26
Only look at the author
| |
Personal signature专注智能产品的研究与开发,专注于电子电路的生产与制造……QQ:2912615383,电子爱好者群: void
|
|
|
9
Published on 2019-2-15 08:56
Only look at the author
This post is from stm32/stm8
| ||
|
||
|
philipchiu
Currently offline
|
This post is from stm32/stm8
| |
|
||
|
11
Published on 2019-2-16 14:43
Only look at the author
This post is from stm32/stm8
| ||
|
||
|
12
Published on 2019-2-17 09:21
Only look at the author
This post is from stm32/stm8
| ||
|
||
|
EEWorld Datasheet Technical Support
EEWorld
subscription
account
EEWorld
service
account
Automotive
development
circle
About Us Customer Service Contact Information Datasheet Sitemap LatestNews
Room 1530, Zhongguancun MOOC Times Building, Block B, 18 Zhongguancun Street, Haidian District, Beijing 100190, China Tel:(010)82350740 Postcode:100190