from machine import Pin
from utime import sleep, sleep_ms
import _thread
cero = Pin(15, Pin.OUT)
uno = Pin(2, Pin.OUT)
dos = Pin(4, Pin.OUT)
tres = Pin(5, Pin.OUT)
cuatro = Pin(18, Pin.OUT)
cinco = Pin(19, Pin.OUT)
seis = Pin(21, Pin.OUT)
siete = Pin(22, Pin.OUT)
leds = [cero, uno, dos, tres, cuatro, cinco, seis, siete]
def tarea_uno():
while True:
for i in leds[0:4:]:
i.value(1)
sleep_ms(100)
i.value(0)
sleep_ms(100)
_thread.start_new_thread(tarea_uno, ())
def tarea_dos():
while True:
for i in leds[7:3:-1]:
i.value(1)
sleep_ms(500)
i.value(0)
sleep_ms(500)
while True:
tarea_dos()