pico-micropython-examples/irq/irq.py

5 wiersze
139 B
Python

2021-01-20 16:52:33 +00:00
from machine import Pin
p2 = Pin(2, Pin.IN, Pin.PULL_UP)
2021-02-22 15:42:29 +00:00
p2.irq(lambda pin: print("IRQ with flags:", pin.irq().flags()), Pin.IRQ_FALLING)