from machine import Pin
from utime import sleep, sleep_ms
import _thread
l1 = Pin(19, Pin.OUT)
l2 = Pin(20, Pin.OUT)
l3 = Pin(21, Pin.OUT)
l4 = Pin(47, Pin.OUT)
l5 = Pin(48, Pin.OUT)
l6 = Pin(45, Pin.OUT)
l7 = Pin(35, Pin.OUT)
l8 = Pin(36, Pin.OUT)
bombillos = [l1, l2, l3, l4, l5, l6, l7, l8]
def tarea_uno():
while True:
for led in bombillos[0:4:1]:
led.on()
sleep_ms(30)
led.off()
sleep_ms(30)
for led in bombillos[3:0:-1]:
led.on()
sleep_ms(50)
led.off()
sleep_ms(50)
_thread.start_new_thread(tarea_uno, ())
while True:
for led in bombillos[4:8:1]:
led.on()
sleep_ms(200)
led.off()
sleep_ms(200)