#Johan Antonio Vasquez Aquino
#602-B
from machine import Pin
import time
b1 = Pin(16, Pin.IN, Pin.PULL_UP)
b2 = Pin(17, Pin.IN, Pin.PULL_UP)
led1=Pin(0, Pin.OUT)
led2=Pin(1, Pin.OUT)
led3=Pin(2, Pin.OUT)
led4=Pin(3, Pin.OUT)
led5=Pin(4, Pin.OUT)
led6=Pin(5, Pin.OUT)
led7=Pin(6, Pin.OUT)
led8=Pin(7, Pin.OUT)
led9=Pin(8, Pin.OUT)
led10=Pin(9, Pin.OUT)
LEDS = [led1, led2, led3, led4, led5, led6,
led7, led8, led9, led10]
pos = 0
LEDS[pos].on()
while True:
if b1.value() == 0:
if pos < len(LEDS) - 1:
LEDS[pos].off()
pos += 1
LEDS[pos].on()
time.sleep_ms(500)
if b2.value() == 0:
if pos > 0:
LEDS[pos].off()
pos -= 1
LEDS[pos].on()
time.sleep_ms(500)