from machine import Pin
from time import sleep
#Configurar los pines de salida
Display=[14, 27, 26, 25, 21, 18, 15]
for i in range(len(Display)):
Pin(Display[i], Pin.OUT)
leds = [
[1,0,0,0,0,0,0],
[1,1,1,1,0,0,1],
[0,1,0,0,1,0,0],
[0,1,1,0,0,0,0],
[0,0,1,1,0,0,1],
[0,0,1,0,0,1,0],
[0,0,0,0,0,1,0],
[1,1,1,1,0,0,0],
[0,0,0,0,0,0,0],
[0,0,1,1,0,0,0],
]
C=0
s=0
Boton = Pin(23,Pin.IN)
Boton.value(0)
# Bucle principal
vector1[]
while True:
if Boton.value() == 1:
s=s+1
sleep(2)
print (s)
if s == 1:
b=0
for j in range(7):
Pin(Display[j], Pin.OUT).value(leds[b][6-j])
if s == 2:
b=1
for j in range(7):
Pin(Display[j], Pin.OUT).value(leds[b][6-j])
#if Boton.value() == 1:
# s=s+1
if s == 3:
b=2
for j in range(7):
Pin(Display[j], Pin.OUT).value(leds[b][6-j])
#if Boton.value() == 1:
# s=s+1
if s == 4:
b=3
for j in range(7):
Pin(Display[j], Pin.OUT).value(leds[b][6-j])
#if Boton.value() == 1:
# s=s+1
if s == 5:
b=4
for j in range(7):
Pin(Display[j], Pin.OUT).value(leds[b][6-j])
if s == 6:
b=5
for j in range(7):
Pin(Display[j], Pin.OUT).value(leds[b][6-j])
if s == 7:
b=6
for j in range(7):
Pin(Display[j], Pin.OUT).value(leds[b][6-j])
if s == 8:
b=7
for j in range(7):
Pin(Display[j], Pin.OUT).value(leds[b][6-j])
if s == 9:
b=8
for j in range(7):
Pin(Display[j], Pin.OUT).value(leds[b][6-j])
if s == 10:
b=9
for j in range(7):
Pin(Display[j], Pin.OUT).value(leds[b][6-j])
if s == 11:
s=0