import machine
from machine import *
import utime

print("adcValue.py")
sensor_temp = machine.ADC(0)
conversion_factor = 3.3 / (65535)
tim0=utime.time()
print("tim0:",tim0)
#Note ADC(0) is GP26 on the pico
adcDevice = machine.ADC(0)
#conversion multiplied by 2 because sampling at mid-resistor
conversion=6.6*3.3/65535
#reading = sensor_temp.read_u16() * conversion_factor
#temperature = 27 - (reading - 0.706)/0.001721
#tim=utime.time()-tim0
#print(tim,temperature)
#tempR=temp.read_u16()*conversion
#tempNow=tempR
while True:
    adcValue=adcDevice.read_u16()
    print("adcValue:",adcValue)
    adcVolt=adcValue*conversion
    print("adcVolt:",adcVolt)
    utime.sleep(2)
#while end
#printTemp.py
