Skip to content

Instantly share code, notes, and snippets.

@dglaude
Created August 9, 2017 22:11
Show Gist options
  • Save dglaude/a2aa9dec0ef20435770cd1310baba06f to your computer and use it in GitHub Desktop.
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
#!/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