Created
November 11, 2017 11:49
-
-
Save ttreitlinger/b6f82d1b9a3ebdc6ea471b1e3bec058e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#runs on https://trinket.io/mission-zero | |
from sense_hat import SenseHat | |
from time import sleep | |
sense = SenseHat() | |
sense.set_rotation(270) | |
#sense.show_message('Hello World',scroll_speed=0.05) | |
temp = sense.get_temperature() | |
temp = round( sense.get_temperature(), 1 ) | |
sense.show_message( str(temp) ) | |
sense.show_message( "It is " + str(temp) + " degrees",scroll_speed=0.05) | |
w = (255, 255, 255) | |
y = (255, 255, 0) | |
g = (0, 255, 0) | |
b = (0, 0, 0) | |
hot = [ | |
b, b, b, b, b, y, y, b, | |
b, b, b, b, y, y, y, y, | |
b, b, b, b, b, y, y, b, | |
b, b, b, b, b, b, b, b, | |
b, b, b, b, b, b, b, b, | |
b, b, b, b, b, b, b, b, | |
g, g, g, g, g, g, g, g, | |
g, g, g, g, g, g, g, g | |
] | |
cold = [ | |
b, b, w, b, b, b, w, b, | |
b, b, b, b, b, w, b, b, | |
b, w, b, b, b, b, b, w, | |
b, b, b, b, w, b, b, b, | |
w, b, b, w, b, b, w, b, | |
b, b, b, b, b, b, b, b, | |
w, w, w, w, w, w, w, w, | |
w, w, w, w, w, w, w, w | |
] | |
temp = sense.get_temperature() | |
if temp >= 20: | |
sense.set_pixels(hot) | |
else: | |
sense.set_pixels(cold) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment