from machine import Pin
import time
clk = Pin(4,Pin.OUT)
latch = Pin(2,Pin.OUT)
ds = Pin(15,Pin.OUT)
dic = {"1" : 0x60, "2" : 0xDA, "3" : 0xF2, "4" : 0x66, "5" : 0xB6,
"6" : 0xBE, "7" : 0xE0, "8" : 0xFE, "9" : 0xF6, "0" : 0xFC}
for i in range(10):
temp = dic.get(str(i))
for i in range(8):
val = temp & 1
ds.value(val)
clk.off()
clk.on()
temp = temp >> 1
latch.off()
latch.on()
time.sleep(1)