# Imports
from machine import Pin
from time import sleep
# Variables
switch_1 = Pin(6, Pin.IN)
switch_2 = Pin(7, Pin.IN)
red = Pin(18, Pin.OUT)
green = Pin(17, Pin.OUT)
blue = Pin(16, Pin.OUT)
# while true loop
while True:
# switch programming
sw1_state = switch_1.value()
sw2_state = switch_2.value()
print("switch 1 state: ", sw1_state)
print("switch 2 state: ", sw2_state)
# conditionals
if sw1_state == 1 and sw2_state == 1:
red.value(1)
green.value(0)
blue.value(0)
elif sw1_state == 1 and sw2_state == 0:
red.value(0)
green.value(1)
blue.value(0)
elif sw1_state == 0 and sw2_state == 1:
red.value(0)
green.value(0)
blue.value(1)
else:
red.value(1)
green.value(1)
blue.value(1)
sleep(0.1)