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