]> vault307.fbx.one Git - random.git/blob - buttonLED-func.py
different projects to learn new things
[random.git] / buttonLED-func.py
1 from machine import Pin
2 import utime
3 led=Pin(15,Pin.OUT)
4 button=Pin(13,Pin.IN)
5 led1=Pin(16,Pin.OUT)
6 button1=Pin(14,Pin.IN)
7 def button_press(pin):
8 led.toggle()
9 def button1_press(pin):
10 led1.toggle()
11 button.irq(trigger=Pin.IRQ_RISING,handler=button_press)
12 button1.irq(trigger=Pin.IRQ_RISING,handler=button1_press)