import time
time.sleep(0.1) # Wait for USB to become ready
print("Hello, Pi Pico!")
from machine import Pin,ADC
pot=ADC(Pin(28))
seg7=(Pin(0,Pin.OUT),Pin(1,Pin.OUT),
Pin(2,Pin.OUT),Pin(3,Pin.OUT),
Pin(4,Pin.OUT),Pin(5,Pin.OUT),
Pin(6,Pin.OUT)) #abcdefg
#0 #1 #2
table=((1,1,1,1,1,1,0),(0,1,1,0,0,0,0),(1,1,0,1,1,0,1),
(1,1,1,1,0,0,1),(0,1,1,0,0,1,1),(1,0,1,1,0,1,1),
(1,0,1,1,1,1,1),(1,1,1,0,0,0,0),(1,1,1,1,1,1,1),
(1,1,1,0,0,1,1)) #0123456789
def disp7(num):
for i in range(7):
seg7[i].value(not table[num][i])
while 1:
val=int((pot.read_u16()/65535)*9)
disp7(val)
time.sleep(0.1)