from machine import Pin
import time
left_switch = Pin(2, Pin.IN, Pin.PULL_DOWN)
right_switch = Pin(3, Pin.IN, Pin.PULL_DOWN)
led = Pin(14, Pin.OUT)
while True:
left_state = left_switch.value()
right_state = right_switch.value()
print(f"Left Switch: {left_state} | Right Switch: {right_state}")
if left_state == 1 and right_state == 0:
led.value(1) # or led.on()
time.sleep(0.5)
led.value(0) # or led.off()
time.sleep(0.5)
else:
led.value(0) # or led.off()
time.sleep(0.5)