import time
time.sleep(0.1) # Wait for USB to become ready
print("Hello, Pi Pico!")
from machine import Pin
leds = [
Pin(14,Pin.OUT), #A
Pin(15,Pin.OUT), #B
Pin(17,Pin.OUT), #C
Pin(18,Pin.OUT), #D
Pin(19,Pin.OUT), #E
Pin(13,Pin.OUT), #F
Pin(12,Pin.OUT), #G
Pin(16,Pin.OUT) #Dp
]
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])
while True:
for n in range(10):
num_print(n)
time.sleep(0.9)