赞
踩
代码
from pyb import Pin,ExtInt,LEDcallback = lambda e: LED(3).toggle()#下降沿触发,打开上拉电阻ext = ExtInt(Pin('P9'), ExtInt.IRQ_FALLING, Pin.PULL_UP, callback)
效果
按下按键,LED3翻转