from machine import Pin, PWM
import time,random
ledRed=Pin(27,Pin.OUT)
ledGreen=Pin(28,Pin.OUT)
ledYellow=Pin(26,Pin.OUT)
ledBlue=Pin(22,Pin.OUT)
def turn_leds(randomvalue):
ledRed.off()
ledGreen.off()
ledYellow.off()
ledBlue.off()
print(randomvalue)
if randomvalue==1:
ledRed.on()
if randomvalue==2:
ledGreen.on()
if randomvalue==3:
ledYellow.on()
if randomvalue==4:
ledBlue.on()
while True:
for d in range (0,20,2):
color = random.randint(1,4)
turn_leds(color)
time.sleep(1)