Created
August 9, 2017 22:11
-
-
Save dglaude/a2aa9dec0ef20435770cd1310baba06f to your computer and use it in GitHub Desktop.
Test program to check every LEDs of your Unicorn HD HAT from @pimoroni
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
#!/usr/bin/env python | |
import time | |
import unicornhathd | |
print("""Unicorn HAT HD: Test pattern | |
Press Ctrl+C to exit! | |
""") | |
try: | |
while True: | |
for x in range(0, 16): | |
for y in range(0, 16): | |
unicornhathd.set_pixel(x, y, 255, 0, 0) | |
unicornhathd.show() | |
time.sleep(2) | |
for x in range(0, 16): | |
for y in range(0, 16): | |
unicornhathd.set_pixel(x, y, 0, 255, 0) | |
unicornhathd.show() | |
time.sleep(2) | |
for x in range(0, 16): | |
for y in range(0, 16): | |
unicornhathd.set_pixel(x, y, 0, 0, 255) | |
unicornhathd.show() | |
time.sleep(2) | |
for x in range(0, 16): | |
for y in range(0, 16): | |
unicornhathd.set_pixel(x, y, 255, 255, 255) | |
unicornhathd.show() | |
time.sleep(2) | |
except KeyboardInterrupt: | |
unicornhathd.off() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment