from machine import Pin
from time import sleep
# LED pins
led_pins = [13,12,14,27,26,25,33,32]
leds = [Pin(pin, Pin.OUT) for pin in led_pins]
# Simple digit patterns (8-bit)
digits = {
"0":[1,1,1,1,1,1,1,0],
"1":[0,1,1,0,0,0,0,0],
"2":[1,1,0,1,1,0,1,0],
"3":[1,1,1,1,0,0,1,0],
"4":[0,1,1,0,0,1,1,0],
"5":[1,0,1,1,0,1,1,0],
"6":[1,0,1,1,1,1,1,0],
"7":[1,1,1,0,0,0,0,0],
"8":[1,1,1,1,1,1,1,0],
"9":[1,1,1,1,0,1,1,0],
":":[0,0,1,0,0,1,0,0]
}
# Example fixed time (baad me RTC use kar sakte ho)
time_str = "12:45"
def display_char(char):
pattern = digits[char]
for i in range(8):
leds[i].value(pattern[i])
sleep(0.05)
while True:
for ch in time_str:
display_char(ch)