Tracking Raspberry Pi Internal Temperatures in Computer Vision Apps

By Lila Mullany • Mar 24, 2020
from temperature_tracker import TemperatureTracker
temperature_tracker = TemperatureTracker()
temperature_tracker.start()
temperature_tracker.update()
now = temperature_tracker.now()
# log block showing current temperature
text.append(“{:1.2f}C/{:1.2f}F at time {}\n”.format(now[0], ((now[0]*(9 / 5)) + 32),time.strftime(‘%Y-%m-%d %H:%M:%S’, now[1])))
# details whether the temperature is safe for a Raspberry Pi 4
if now[0] < temperature_tracker.MAX_TEMP_RASP4:
text.append(“Temperature is safe”)
else:
text.append(“TEMPERATURE IS NO LONGER SAFE”)
if now[0] >= temperature_tracker.MAX_TEMP_RASP4:
print(“Maximum safe temperature reached, stopping program”)
break
temperature_tracker.stop()
summary = temperature_tracker.summary()
print(summary)
aai app configure
aai app install
aai app start

 

By Lila Mullany • Mar 24, 2020

POST BY CV TYPE

POST BY DEVICE TAGS

POPULAR TAGS

Developer stories to your inbox.

Subscribe to the Developer Digest, a monthly dose of all things code.

You may unsubscribe at any time using the unsubscribe link in the digest email. See our privacy policy for more information.

alwaysAI Ad
stylized image of a computer chip

Sign up today and start your project

We can't wait to see what you'll build!