from machine import Pin
import time
leds = [Pin(0,Pin.OUT),Pin(1,Pin.OUT),Pin(2,Pin.OUT),Pin(3,Pin.OUT),
Pin(4,Pin.OUT),Pin(5,Pin.OUT),Pin(6,Pin.OUT),Pin(7,Pin.OUT)]
def all_off():
for l in leds:
l.off()
while True:
for l in leds:
l.on()
time.sleep(0.3)
all_off()
time.sleep(0.3)