from machine import Pin
import utime
# Creando objetos
led1 = Pin(14,Pin.OUT)
led2 = Pin(27,Pin.OUT)
led3 = Pin(26,Pin.OUT)
led4 = Pin(25,Pin.OUT)
led5 = Pin(33,Pin.OUT)
led6 = Pin(32,Pin.OUT)
led7 = Pin(12,Pin.OUT)
led8 = Pin(13,Pin.OUT)
leds = [led1, led2, led3, led4, led5, led6, led7, led8]
while True:
for iluminacion in leds[::1]:# Recorre la lista empezando del 1er elemento
iluminacion.value(1)
utime.sleep_ms(30)
iluminacion.value(0)
utime.sleep_ms(30)
for iluminacion in leds[::-1]:
iluminacion.value(1)
utime.sleep_ms(30)
iluminacion.value(0)
utime.sleep_ms(30)