from machine import Pin
import utime

L=[0,1,2,3,4]
sw=[5,6]
n=0
sw1=Pin(sw[0],Pin.IN,Pin.PULL_UP)
sw2=Pin(sw[1],Pin.IN,Pin.PULL_UP)
        
while True:
    
    if sw1.value()==0:
        for n in range(5):
            LNO = Pin(L[n], Pin.OUT)
            LNO.value(1)
            utime.sleep(0.5)
            print("sw1")
    elif sw2.value()==0:
        for n in range(4,-1,-1):
            LNO = Pin(L[n], Pin.OUT)
            utime.sleep(0.5)
            LNO.value(1)
            print("sw2")
    else:
        for x in range(5):
            LNO = Pin(L[x], Pin.OUT)       
            LNO.value(0)
            print("OFF")
    
    utime.sleep_ms(20)
