Skip to content

Instantly share code, notes, and snippets.

@gthoppae
Last active September 23, 2016 13:27
Show Gist options
  • Save gthoppae/6d262d978df30f6807a2bc01697bf4c7 to your computer and use it in GitHub Desktop.
Save gthoppae/6d262d978df30f6807a2bc01697bf4c7 to your computer and use it in GitHub Desktop.
Sensor reading from Sense HAT
from sense_hat import SenseHat
sense = SenseHat()
while True:
t = sense.get_temperature()
p = sense.get_pressure()
h = sense.get_humidity()
t = round(t, 1)
p = round(p, 1)
h = round(h, 1)
msg = "T={0}, P={1}, H={2}".format(t,p,h)
sense.show_message(msg, scroll_speed=0.05)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment