Adafruit_CircuitPython_Circ.../examples/circuitplayground_temperture.py
2019-06-07 14:45:09 -04:00

10 lines
443 B
Python

"""This example uses the temperature sensor on the CPX, located next to the image of a thermometer
on the board. It prints the temperature in both C and F to the serial console. Try putting your
finger over the sensor to see the numbers change!"""
import time
from adafruit_circuitplayground.express import cpx
while True:
print("Temperature C:", cpx.temperature)
print("Temperature F:", cpx.temperature * 1.8 + 32)
time.sleep(1)