from machine import Pin
import time
pin_rojo = Pin(18, Pin.OUT)
pin_verde = Pin(19, Pin.OUT)
pin_azul = Pin(20, Pin.OUT)
def set_color(r, g, b):
pin_rojo.value(not r)
pin_verde.value(not g)
pin_azul.value(not b)
colores = [
(1, 0, 0), # Rojo
(0, 1, 0), #Verde
(0, 0, 1), #Azul
(1, 1, 0), #Amarillo
(0, 1, 1,), #Cian
(1, 0, 1), #Magenta
]
while True:
for r, g, b in colores:
set_color(r, g, b)
time.sleep(1)