from machine import Pin
import utime as time
led_pins1 = Pin(6, Pin.OUT)
led_pins2 = Pin(7, Pin.OUT)
led_pins3 = Pin(8, Pin.OUT)
switch1 = Pin(2, Pin.IN, Pin.PULL_UP)
switch2 = Pin(3, Pin.IN, Pin.PULL_UP)
switch3 = Pin(4, Pin.IN, Pin.PULL_UP)
switch4 = Pin(9, Pin.IN, Pin.PULL_UP)
while True:
switch1_state = switch1.value()
switch2_state = switch2.value()
switch3_state = switch3.value()
switch4_state = switch4.value()
if switch1_state == 0:
led_pins1.on()
led_pins2.off()
led_pins3.off()
elif switch2_state == 0:
led_pins1.off()
led_pins2.on()
led_pins3.off()
elif switch3_state == 0:
led_pins1.off()
led_pins2.off()
led_pins3.on()
elif switch4_state == 0:
led_pins1.off()
led_pins2.off()
led_pins3.off()
time.sleep(0.1)