from machine import ADC
import time
adc = ADC(26) # GP26 = ADC0
period_ms = 500
print("PICO SENSOR NODE READY")
print("Rotate the potentiometer to change ADC value")
last = time.ticks_ms()
while True:
now = time.ticks_ms()
if time.ticks_diff(now, last) >= period_ms:
last = now
raw = adc.read_u16() # 0..65535
volt = raw * 3.3 / 65535
print("ADC0_RAW:", raw, "V:", round(volt, 3))