from machine import Pin
import time
# Define GPIO pins
led_pin1 = Pin(2, Pin.OUT)
led_pin2 = Pin(???, Pin.OUT)
switch1_pin = Pin(14, Pin.IN)
switch2_pin = Pin(???, Pin.IN)
# Main loop
while True:
# initial state
led_pin1.off()
led_pin2.off()
# Read the state of the switch
switch1_state = switch1_pin.value()
switch2_state = switch2_pin.value()
# If the switch is ON, turn the LED ON, else turn it OFF
if switch1_state == 1:
led_pin1.on()
led_pin2.off()
# If the switch is ON, turn the LED ON, else turn it OFF
if switch2_state == 1:
led_pin1.off()
led_pin2.on()
# Delay for a short period
time.sleep(0.1)