from machine import Pin
from time import sleep
pins = [Pin(_, Pin.OUT) for _ in range(5)]
# 0,1,2 -> 1,2,3 -> 2,3,4 -> 3,4,0 -> 4,0,1
while True:
for i in range(len(pins)):
pins[i % 5].on()
pins[(i+2) % 5].on()
sleep(2)
pins[i].off()