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

a = Pin(15, Pin.OUT)
b = Pin(2, Pin.OUT)
c = Pin(0, Pin.OUT)
d = Pin(4, Pin.OUT)
e = Pin(16, Pin.OUT)
f = Pin(17, Pin.OUT)
g = Pin(5, Pin.OUT)
h = Pin(18, Pin.OUT)

leds = [a, b, c, d, e, f, g, h]
###############################################
def derecha():
    while True:
        for bombillo in leds[0:4:1]:
            bombillo.on()
            sleep_ms(110)
            bombillo.off()
            sleep_ms(110)

_thread.start_new_thread(derecha, ())
############################################
def izquierda():
    for bombillo in leds[8:3:-1]:
        bombillo.on()
        sleep_ms(110)
        bombillo.off()
        sleep_ms(110)

while True:
    izquierda()

    
    

Loading
esp32-devkit-c-v4