from machine import Pin, Timer
import time
pins = [19, 18, 5]
leds = [Pin(p, Pin.OUT, value=0) for p in pins]
# actually .5 the period. this is the duration the led is off or on
periods = [1000, 3000, 1200]
times = [time.ticks_add(time.ticks_ms(), p) for p in periods]
while True:
now = time.ticks_ms()
for i, led in enumerate(leds):
if time.ticks_diff(now, times[i]) >= 0:
led.value(not led.value())
times[i] = time.ticks_add(times[i], periods[i])
print(times[i])
time.sleep_ms(20)