Last active
April 4, 2018 15:13
-
-
Save bennuttall/fd684f2d24e5c67a306410da54a39362 to your computer and use it in GitHub Desktop.
Demo using sense_hat and sense_emu together to control the Sense HAT's physical LEDs using the emulator's temperature sensor slider
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
from sense_hat import SenseHat | |
from sense_emu import SenseHat as SenseEmu | |
hat = SenseHat() | |
emu = SenseEmu() | |
while True: | |
temp = emu.temperature | |
r = int(min(max(0, temp), 100) / 100 * 255) | |
print('{:3d}'.format(r), end='\r', flush=True) | |
hat.clear(r, 0, 0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment