Adafruit_CircuitPython_Feat.../examples/featherwing_tempmotion_simpletest.py
2020-03-16 16:41:21 -04:00

14 lines
428 B
Python

"""
This example will show the current temperature in the Serial Console
whenever the FeatherWing senses that it has been tapped
"""
import time
from adafruit_featherwing import tempmotion_featherwing
temp_motion = tempmotion_featherwing.TempMotionFeatherWing()
temp_motion.enable_tap_detection()
while True:
if temp_motion.events["tap"]:
print("The temperature is %f" % temp_motion.temperature)
time.sleep(1)