from utime import sleep
import machine 


leds = [
    machine.Pin(13,machine.Pin.OUT),
    machine.Pin(10,machine.Pin.OUT),
    machine.Pin(8,machine.Pin.OUT),
    machine.Pin(5,machine.Pin.OUT),
    machine.Pin(2,machine.Pin.OUT)
]

rightbutton=machine.Pin(18,machine.Pin.IN,machine.Pin.PULL_UP)
leftbutton=machine.Pin(28,machine.Pin.IN,machine.Pin.PULL_UP)

current_led = 0



while True:
    if not leftbutton.value():
        leds[current_led].value(1)
        sleep(0.5)
        leds[current_led].value(0)
        current_led = (current_led + 1) % len(leds)
        sleep(0.3)
    
    if not rightbutton.value():
        leds[current_led].value(1)
        sleep(0.5)
        leds[current_led].value(0)
        current_led = (current_led - 1) % len(leds)
        sleep(0.3)
        



    
BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT
BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT