from machine import Pin, ADC
#configure ADC
adc = ADC(Pin(35))
adc.atten(ADC.ATTN_11DB) #sets for max input voltage of 3.6 volts
adc.width(ADC.WIDTH_12BIT) #sets bit width to 12 bits
#Enter While loop
while True:
adc_value = adc.read() #read voltage on sig pin of potentiometer
volts = (3.3*adc_value)/4095 #convert Raw adc value to actual voltage value
#print out actual voltage and raw adc value
input_voltage = "the input voltage is {:0.2f} volts and raw value is {:4d}"
print(input_voltage .format(volts,adc_value),end = "\r")