from machine import Pin
from time import sleep
swtR=Pin(2,Pin.IN,Pin.PULL_DOWN)
swtG=Pin(6,Pin.IN,Pin.PULL_DOWN)
swtB=Pin(13,Pin.IN,Pin.PULL_DOWN)
red=Pin(18,Pin.OUT)
green=Pin(17,Pin.OUT)
blue=Pin(16,Pin.OUT)
while True:
v1=swtR.value()
v2=swtG.value()
v3=swtB.value()
if(v1==1):
red.on()
print("RED LED")
sleep(0.1)
elif(v2==1):
green.on()
print("GREEN LED")
sleep(0.1)
elif(v3==1):
blue.on()
print("BLUE LED")
sleep(0.1)
else:
red.off()
green.off()
blue.off()
print("LED OFF")
sleep(0.1)