from machine import Pin
from time import sleep_ms
led01 = Pin(18, Pin.OUT)
led02 = Pin(19, Pin.OUT)
led03 = Pin(21, Pin.OUT)
led04 = Pin(22, Pin.OUT)
led01.off()
led02.off()
led03.off()
led04.off()
while True:
sleep(0.5)
led01.value(not led01.value())
led02.value(not led02.value())
led03.value(not led03.value())
led04.value(not led04.value())
from machine import Pin
from time import sleep_ms
led = []
t_ms = 100
for i in range(0, 4):
led.append(Pin(16+i, Pin.OUT))
while True:
for i in range(0, 4):
led[i].on()
sleep_ms(t_ms)
led[i].off()
sleep_ms(t_ms)
for i in range(2, 0, -1):
led[i].on()
sleep_ms(t_ms)
led[i].off()
sleep_ms(t_ms)