Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from machine import Pin
- import time
- # Initialize the LED and button pins
- led1 = Pin(16, Pin.OUT)
- led2 = Pin(17, Pin.OUT)
- button1 = Pin(18, Pin.IN, Pin.PULL_DOWN)
- button2 = Pin(19, Pin.IN, Pin.PULL_DOWN)
- while True:
- if button1.value() == 1:
- led1.on()
- else:
- led1.off()
- if button2.value() == 1:
- led2.on()
- else:
- led2.off()
- time.sleep(0.1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement