from machine import Pin
import time
# Pines conectados a los segmentos a-g
segmentos = [
Pin(0, Pin.OUT), # a
Pin(1, Pin.OUT), # b
Pin(2, Pin.OUT), # c
Pin(3, Pin.OUT), # d
Pin(4, Pin.OUT), # e
Pin(5, Pin.OUT), # f
Pin(6, Pin.OUT) # g
]
# Tabla de números (0–9) sin usar funciones
numeros = {
0: [1,1,1,1,1,1,0],
1: [0,1,1,0,0,0,0],
2: [1,1,0,1,1,0,1],
3: [1,1,1,1,0,0,1],
4: [0,1,1,0,0,1,1],
5: [1,0,1,1,0,1,1],
6: [1,0,1,1,1,1,1],
7: [1,1,1,0,0,0,0],
8: [1,1,1,1,1,1,1],
9: [1,1,1,1,0,1,1]
}
while True:
segmentos[0].value(patron[0])
time.sleep(1) # espera 1 segund