Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- import machine
- import time
- sensor_temp = machine.ADC(4)
- conversion_factor = 3.3 / (65535)
- t = u"\u00b0"
- while True:
- reading = sensor_temp.read_u16() * conversion_factor
- Ctemp = 27 - (reading - 0.706)/0.001721
- Ftemp = (Ctemp*(9/5))+32
- println(Ctemp + t + "C - " + Ftemp + t + "F")
- time.sleep(2)
Add Comment
Please, Sign In to add comment