# 10 SSD for 00-99
'''
write a micropython script to display the digits from 00 to 99 with the help of
2 seven segment displays connected to different data pins of esp32.
'''
# Common Anode
from machine import Pin
from time import sleep
pins1=[Pin(32, Pin.OUT),Pin(33, Pin.OUT),Pin(25, Pin.OUT),Pin(26, Pin.OUT),
Pin(27, Pin.OUT),Pin(14, Pin.OUT),Pin(12, Pin.OUT)]
pins2=[Pin(23, Pin.OUT),Pin(22, Pin.OUT),Pin(19, Pin.OUT),Pin(18, Pin.OUT),
Pin(5, Pin.OUT),Pin(4, Pin.OUT),Pin(2, Pin.OUT)]
digits=[[0,0,0,0,0,0,1],
[1,0,0,1,1,1,1],
[0,0,1,0,0,1,0],
[0,0,0,0,1,1,0],
[1,0,0,1,1,0,0],
[0,1,0,0,1,0,0],
[0,1,0,0,0,0,0],
[0,0,0,1,1,1,1],
[0,0,0,0,0,0,0],
[0,0,0,0,1,0,0]
]
while True:
for i in range(100):
hd=i//10
ld=i%10
for j in range(7):
pins2[j].value(digits[hd][j])
pins1[j].value(digits[ld][j])
sleep(1)