from machine import Pin
from utime import sleep
led=Pin(0,Pin.OUT)
Faster=Pin(7,Pin.IN,Pin.PULL_UP)
Slower=Pin(8,Pin.IN,Pin.PULL_UP)
dly=1.0
def Flash_faster(Faster):
global dly
dly=dly-0.1
def Flash_slower(Slower):
global dly
dly=dly+0.1
Faster.irq(handler=Flash_faster,trigger=Faster.IRQ_FALLING)
Slower.irq(handler=Flash_slower,trigger=Slower.IRQ_FALLING)
while True:
led.value(1)
sleep(dly)
led.value(0)
sleep(dly)