from machine import Pin
import time
led_pins = [Pin(22, Pin.OUT),
Pin(26, Pin.OUT),
Pin(27, Pin.OUT)]
def set_leds(value):
for i in range(3):
led_pins[i].value((value >> i) & 1)
counter = 0
while True:
set_leds(counter)
counter = (counter + 1) % 8
time.sleep(1)