Last active
December 2, 2016 20:48
-
-
Save mleyvaz/a68f6264877a0b97c2d7a8bc92d9d44c 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
# Read the temperature in the -40 to 120 interval and shows in the leds | |
from sense_hat import SenseHat | |
sense = SenseHat() | |
red = (255, 0, 0) | |
blue = (0, 0, 255) | |
while True: | |
temp = sense.temp | |
print(temp) | |
temp=int(((-40-temp)/(-40-120))*60) | |
pixels = [red if i < temp else blue for i in range(64)] | |
sense.set_pixels(pixels) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Read the temperature in the -40 to 120 interval and shows in the led in the Raspberry Pi Sense HAT . Try it out at
https://trinket.io/library/trinkets/create?lang=python