Skip to content

Instantly share code, notes, and snippets.

@duncanmorris
Last active November 15, 2017 13:08
Show Gist options
  • Save duncanmorris/792e8a07ab391d12ce979e996b5e11a7 to your computer and use it in GitHub Desktop.
Save duncanmorris/792e8a07ab391d12ce979e996b5e11a7 to your computer and use it in GitHub Desktop.
from sense_hat import SenseHat
import time
sense = SenseHat()
sense.set_rotation(270)
temp = sense.get_temperature()
o = (0, 0, 0)
l = (255,165,0) #leg
b = (255, 0, 0) #body
w = (46, 139, 87) #wing
e = (0,0,255) #eye
for i in range(15):
pixels = [
o, o, b, b, o, o, o, o,
o, b, b, b, b, o, o, o,
l, b, e, b, b, o, o, w,
o, b, b, b, w, w, w, w,
o, b, b, b, w, w, w, w,
o, o, b, b, b, b, b, o,
o, o, b, b, b, o, o, o,
o, o, l, o, l, o, o, o,
]
sense.set_pixels(pixels)
time.sleep(1)
pixels = [
o, o, b, b, o, o, o, o,
o, b, b, b, b, o, o, o,
l, b, e, b, b, o, o, o,
o, b, b, b, w, w, o, o,
o, b, b, b, w, w, w, w,
o, o, b, b, b, w, w, w,
o, o, b, b, b, o, o, w,
o, o, l, o, l, o, o, o,
]
sense.set_pixels(pixels)
time.sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment