# potmeter: 0 - 3.3 volt
from machine import Pin, ADC
import time
time.sleep(0.1) # Wait for USB to become ready
print("Hello, Pi Pico!")
pot = ADC(Pin(28))
# potmeter: 0 - 65535 waarde: 0 - 100
# puntX1Y1: (0,0) puntX2Y2: (65535,100)
# y-y1 = m(x-x1) m = (y2-y1)/(x2-x1)
#
while True:
pot_value = pot.read_u16() # read value, 0-65535 across voltage range 0.0v - 3.3v
volt = pot_value * 3.3 /2**16
print("Pot_value=",pot_value, "\tVolt =", volt)
time.sleep(0.5)