import machine
from machine import Pin
import time
leds=[]
leds.append(Pin(23,Pin.OUT))
leds.append(Pin(22,Pin.OUT))
leds.append(Pin(21,Pin.OUT))
leds.append(Pin(19,Pin.OUT))
leds.append(Pin(18,Pin.OUT))
leds.append(Pin(5,Pin.OUT))
leds.append(Pin(17,Pin.OUT))
leds.append(Pin(16,Pin.OUT))
btnVerde = Pin(34,Pin.IN,Pin.PULL_DOWN)
btnRojo = Pin(35,Pin.IN,Pin.PULL_DOWN)
btnAzul = Pin(32,Pin.IN,Pin.PULL_DOWN)
con=0
val=True
while True:
if btnVerde.value()==1:
while True :
for x in range (0,7,2):
leds[x].value(val)
time.sleep(2)
for x in range (0,7,2):
leds[x].value(not val)
time.sleep(.2)
if btnRojo.value()==1:
while True :
leds[1].value(1)
leds[3].value(1)
leds[5].value(1)
leds[7].value(1)
time.sleep(.2)
if btnAzul.value()==1:
break
leds[1].value(0)
leds[3].value(0)
leds[5].value(0)
leds[7].value(0)
time.sleep(.2)
if btnAzul.value()==1:
break