from machine import Pin
from utime import sleep, sleep_ms
import _thread
l1= Pin(47, Pin.OUT)
l2= Pin(48, Pin.OUT)
l3= Pin(45, Pin.OUT)
l4= Pin(35, Pin.OUT)
l5= Pin(36, Pin.OUT)
l6= Pin(37, Pin.OUT)
l7= Pin(38, Pin.OUT)
l8= Pin(39, Pin.OUT)
leds = [l1,l2,l3,l4,l5,l6,l7,l8]
def tarea_uno():
while True:
for bombillo in leds[0:4:1]:
bombillo.on()
sleep_ms(50)
bombillo.off()
sleep_ms(50)
for bombillo in leds[3:0:-1]:
bombillo.on()
sleep_ms(50)
bombillo.off()
sleep_ms(50)
_thread.start_new_thread(tarea_uno, ())
def izquierda():
for bombillo in leds[4:8:1]:
bombillo.on()
sleep_ms(500)
bombillo.off()
sleep_ms(500)
while True:
izquierda()