3556 views|3 replies

136

Posts

2

Resources
The OP
 

MicroPython Universal Button Tutorial [Copy link]

 from pyb import Pin #Introduce pinfrom pyb import ExtInt #Introduce interruptcallbackup = lambda e: print("up") #Define key callbackcallbackdown = lambda e: print("down") #Define key callbackcallbackleft = lambda e: print("left") #Define key callbackcallbackright = lambda e: print("right") #Define key callbackcallbackok = lambda e: print("ok") #Define key callbackext = ExtInt(Pin('W10'), ExtInt.IRQ_FALLING, Pin.PULL_UP, callbackup) #Define key callbackext = ExtInt(Pin('W11'), ExtInt.IRQ_FALLING, Pin.PULL_UP, callbackdown) #Define key callbackext = ExtInt(Pin('W12'), ExtInt.IRQ_FALLING, Pin.PULL_UP, callbackleft) #Define key callbackext = ExtInt(Pin('W13'), ExtInt.IRQ_FALLING, Pin.PULL_UP, callbackright)#define key callback ext = ExtInt(Pin('W14'), ExtInt.IRQ_FALLING, Pin.PULL_UP, callbackok) #define key callback This information is reproduced from openioe and the Internet

Latest reply

The original buttons don't have debounce processing, but the buttons of pyboardCN V2 have it.  Details Published on 2018-6-22 14:05
 
 

1297

Posts

2

Resources
2
 
Doesn't this need to be debounced? Has the hardware already done it?

Comments

Anti-shake can add delay code to anti-shake  Details Published on 2018-6-22 14:05
Anti-shake can add delay code to anti-shake  Details Published on 2018-6-22 08:57
 
 
 

136

Posts

2

Resources
3
 
johnrey posted on 2018-6-21 22:38 Does this not need de-shaking? Has the hardware been solved?
Delay code can be added to de-shake
 
 
 

1w

Posts

25

Resources
4
 
johnrey posted on 2018-6-21 22:38 Doesn't this need debounce? Has the hardware already done it?
The original buttons don't have debounce processing, but the buttons of pyboardCN V2 have it.
 
 
 

Guess Your Favourite
Find a datasheet?

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

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