目录

工欲善其事

实践出真知

活跃标签: linux java mysql 待分类 windows js win10 springboot pdf idea docker 电路 esp32 vue macOS nginx git Arduino maven ffmpeg

存档:

使用MicorePython驱动数码管和中断

from machine import Pin
import time
import tm1637

smg=tm1637.TM1637(clk=Pin(16),dio=Pin(17)) 


key1=Pin(14,Pin.IN,Pin.PULL_UP)

n=0

def key1_irq(key1):
    global n
    time.sleep_ms(10)
    if key1.value()==0:
        n=0

#程序入口
if __name__=="__main__":
  
    key1.irq(key1_irq,Pin.IRQ_FALLING)
  
  
    while True:
        smg.number(n)
        n+=1
        time.sleep(1)


标题:使用MicorePython驱动数码管和中断
作者:llilei
地址:http://solo.llilei.work/articles/2024/04/16/1713277991857.html