from machine import ADC
from time import sleep_ms
import math
BETA = 3950.0
ADCMAX = 2**16 - 1
# Setup ADC
adc = ADC(0) # ADC0 is GP26
# Read the values
while True:
try:
# Read the voltage ratio from Pin 26
analogValue = adc.read_u16()
# calculate temperature in celsius from analogValue
tempC =
print(f"Temperature: {tempC:.3f}°C")
sleep_ms(1000) #delay of 1000 milliseconds
except KeyboardInterrupt:
break
print("Finished")