import time
time.sleep(0.1) # Wait for USB to become ready
print("Hello, Pi Pico!")
from machine import Pin
leds = [
Pin(11,Pin.OUT), #A
Pin(15,Pin.OUT), #B
Pin(18,Pin.OUT), #C
Pin(20,Pin.OUT), #D
Pin(21,Pin.OUT), #E
Pin(12,Pin.OUT), #F
Pin(17,Pin.OUT), #G
Pin(19,Pin.OUT) #Dp
]
gnds = [
Pin(16, Pin.OUT), #dig4
Pin(14, Pin.OUT), #dig3
Pin(13, Pin.OUT), #dig2
Pin(10, Pin.OUT), #dig1
]
for gnd in gnds:
gnd.high()
nums = [
[1,1,1,1,1,1,0], #0
[0,1,1,0,0,0,0], #1
[1,1,0,1,1,0,1], #2
[1,1,1,1,0,0,1], #3
[0,1,1,0,0,1,1], #4
[1,0,1,1,0,1,1], #5
[1,0,1,1,1,1,1], #6
[1,1,1,0,0,0,0], #7
[1,1,1,1,1,1,1], #8
[1,1,1,1,0,1,1], #9
]
def num_print(num):
for i in range(7):
leds[i].value(nums[num][i])
def number_print(number):
a = number
for i in range(4):
num_print(a % 10)
gnds[i].low()
gnds[i].high()
a = a // 10
#------------BEGIN---------------
b = int(input())
while True:
time.sleep(0.01)
number_print(b)