from machine import Pin
from utime import sleep
led=Pin(0,Pin.OUT)
Faster=Pin(1,Pin.IN,Pin.PULL_UP)
Slower=Pin(2,Pin.IN,Pin.PULL_UP)
delay=1.0
def fast_flash(Faster):
global delay
delay-=0.1
def slow_flash(Slower):
global delay
delay+=0.1
Faster.irq(handler=fast_flash,trigger=Faster.IRQ_FALLING)
Slower.irq(handler=slow_flash,trigger=Slower.IRQ_FALLING)
while True:
led.value(1)
sleep(delay)
led.value(0)
sleep(delay)