I try resolve subject problem from
viewtopic.php?t=1938
(special thanks from dhylands for this useful post)
Who can help me for change IRQ handler to resolve this problem in this example
http://docs.micropython.org/en/v1.9.3/e ... /pins.html
Thanks Armen
Code: Select all
def callback(p):
print('pin change', p)
print(led.value())
from machine import Pin
from time import sleep
p0 = Pin(12, Pin.IN)
p2 = Pin(4, Pin.IN)
led = Pin(14, Pin.OUT)
p0.irq(trigger=Pin.IRQ_FALLING, handler=callback)
p2.irq(trigger=Pin.IRQ_RISING | Pin.IRQ_FALLING, handler=callback)
while True:
led.value(not led.value())
sleep(0.5)