print("Hello, ESP32!")

from machine import Pin 
from time import sleep 

#CONFIGURAR PINES DE SALIDA Y ENTRADA
OUT1 = Pin(13,Pin.OUT)
Boton = Pin(23,Pin.IN)

#CICLO INFINITO
while True: 

#Definir display o matriz
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],

    ]

#IMPRIMIR VALOR DIGITAL EN LAS SALIDAS
OUT1.value(0) #APAGADO
OUT1.value(1) #ENCENDIDO

#LECTURA DE ENTRADAS
actual=Boton.value() #SE ASIGNA A LA VARIABLE ACTUAL

#CONDICIONALES
if actual == 1 and anterior == 0  : 
            s=s+1

#TIEMPO DE RETARDO
sleep()

#FOR PARA UTILIZAR EL VALOR DE LA MATRIZ
for j in range(7):
                    Pin(Display[j], Pin.OUT).value(leds[U1][6-j])