Closed
Description
from machine import Pin
import utime
import _thread
interruptCounter = 0
def callback(pin):
global interruptCounter
interruptCounter = interruptCounter+1
def foo():
p16 = Pin(16, Pin.IN, Pin.PULL_UP)
p16.irq(callback, Pin.IRQ_FALLING)
while True:
utime.sleep(1)
_thread.start_new_thread(foo, ())
while True:
print(interruptCounter)
utime.sleep(1)
The irq is not work
Metadata
Metadata
Assignees
Labels
No labels