from machine import Pin
from utime import sleep, sleep_ms
import _thread

la= Pin(15, Pin.OUT)
lb= Pin(2, Pin.OUT)
lc= Pin(4, Pin.OUT)
ld= Pin(16, Pin.OUT)
le= Pin(17, Pin.OUT)
lf= Pin(5, Pin.OUT)
lg= Pin(18, Pin.OUT)
lh= Pin(19, Pin.OUT)

leds = [la,lb,lc,ld,le,lf,lg,lh]

def derecha():
    while True:
        for i in leds[0:4:1]:
            i.on()
            sleep_ms(50)
            i.off()
            sleep_ms(50)

_thread.start_new_thread(derecha, ())

'''def izquierda(): 
    for i in leds[::-1]:
        i.on()
        sleep_ms(50)
        i.off()
        sleep_ms(50)  '''

while True:
    for i in leds[8:3:-1]:
        i.on()
        sleep_ms(500)
        i.off()
        sleep_ms(500)