You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the below code, whether or not you created ADC3 affects the reading of ADC4. With the line commented out, I get a reading of about 17 degrees. With it there I get a reading of about 80.
import machine
import time
sensor_temp = machine.ADC(4)
blah = machine.ADC(3) # comment or uncomment this line to trigger / untrigger
conversion_factor = 3.3 / 65535
min_temp = 0
max_temp = 30
while True:
reading = sensor_temp.read_u16() * conversion_factor
temperature = 27 - (reading - 0.706)/0.001721
print(temperature)
time.sleep(0.5)