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

Tracking Raspberry Pi Internal Temperatures in Computer Vision Applications

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 deploy
aai app start

 

By Lila Mullany Mar 24, 2020