Skip to content

Instantly share code, notes, and snippets.

@foresmac
Last active March 1, 2016 17:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save foresmac/9ec3c553f3f69151d02b to your computer and use it in GitHub Desktop.
Save foresmac/9ec3c553f3f69151d02b to your computer and use it in GitHub Desktop.
from sense_hat import SenseHat
import time
p = (128, 0, 255)
b = (0, 0, 0)
frame1 = [
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, b, b, p, 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, b, b, b,
b, b, b, b, b, b, b, b,
]
frame2 = [
b, b, b, b, b, b, b, b,
b, b, b, b, b, b, b, b,
b, b, b, p, b, b, b, b,
b, b, p, p, p, b, b, b,
b, b, b, p, 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, b, b, b,
]
frame3 = [
b, b, b, b, b, b, b, b,
b, p, b, p, b, p, b, b,
b, b, p, p, p, b, b, b,
b, p, p, p, p, p, b, b,
b, b, p, p, p, b, b, b,
b, p, b, p, b, p, b, b,
b, b, b, b, b, b, b, b,
b, b, b, b, b, b, b, b,
]
frame4 = [
p, b, b, p, b, b, p, b,
b, p, b, p, b, p, b, b,
b, b, p, p, p, b, b, b,
p, p, p, p, p, p, p, b,
b, b, p, p, p, b, b, b,
b, p, b, p, b, p, b, b,
p, b, b, p, b, b, p, b,
b, b, b, b, b, b, b, b,
]
all_frames = [frame1, frame2, frame3, frame4, frame3, frame2]
hat = SenseHat()
while True:
for frame in all_frames:
hat.set_pixels(frame)
time.sleep(1/3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment