from machine import Pin
from time import sleep_ms
leds = [
Pin(22, Pin.OUT),
Pin(21, Pin.OUT),
Pin(19, Pin.OUT),
Pin(18, Pin.OUT),
Pin(5, Pin.OUT),
Pin(17, Pin.OUT),
Pin(16, Pin.OUT),
Pin(4, Pin.OUT),
Pin(2, Pin.OUT),
Pin(15, Pin.OUT)
]
y = 0
z = 100
som = Pin(14, Pin.OUT)
while True:
for x in range (10-y):
leds[x].value(1)
sleep_ms(z)
x = 10
for x in reversed(range (10-y)):
leds[x].value(0)
sleep_ms(z)
y+=1
z-=9
if y == 10:
y = 0
z = 100