Adafruit_Learning_System_Gu.../Introducing_CircuitPlaygroundExpress/CircuitPlaygroundExpress_Temperature.py
2017-10-09 22:27:54 -07:00

15 lines
416 B
Python

# CircuitPlaygroundExpress_Temperature
# reads the on-board temperature sensor and prints the value
import adafruit_thermistor
import board
import time
thermistor = adafruit_thermistor.Thermistor(board.TEMPERATURE, 10000, 10000, 25, 3950)
while True:
print("Temperature is: %f C and %f F" % (thermistor.temperature,
(thermistor.temperature*9/5+32)))
time.sleep(0.25)