Skip to content

Instantly share code, notes, and snippets.

@Sandyman
Last active August 11, 2020 03:58
Show Gist options
  • Save Sandyman/775fae91b18aede722772691189a2d95 to your computer and use it in GitHub Desktop.
Save Sandyman/775fae91b18aede722772691189a2d95 to your computer and use it in GitHub Desktop.
Default sensehat code with a few extra icons
from sense_hat import SenseHat
import time
s = SenseHat()
s.low_light = True
red = (255, 0, 0)
white = (255,255,255)
nothing = (0,0,0)
def clubs():
P = nothing
O = white
logo = [
O, O, O, P, O, O, O, O,
O, O, P, P, P, O, O, O,
O, O, O, P, O, O, O, O,
O, P, O, P, O, P, O, O,
P, P, P, P, P, P, P, O,
O, P, O, P, O, P, O, O,
O, O, O, P, O, O, O, O,
O, O, O, P, O, O, O, O,
]
return logo
def spade():
P = nothing
O = white
logo = [
O, O, O, O, O, O, O, O,
O, O, O, P, O, O, O, O,
O, O, P, P, P, O, O, O,
O, P, P, P, P, P, O, O,
P, P, P, P, P, P, P, O,
P, P, P, P, P, P, P, O,
O, P, O, P, O, P, O, O,
O, O, O, P, O, O, O, O,
]
return logo
def heart():
P = red
O = white
logo = [
O, O, O, O, O, O, O, O,
O, P, P, O, P, P, O, O,
P, P, P, P, P, P, P, O,
P, P, P, P, P, P, P, O,
O, P, P, P, P, P, O, O,
O, O, P, P, P, O, O, O,
O, O, O, P, O, O, O, O,
O, O, O, O, O, O, O, O,
]
return logo
def diamond():
R = red
O = white
logo = [
O, O, O, O, O, O, O, O,
O, O, O, R, O, O, O, O,
O, O, R, R, R, O, O, O,
O, R, R, R, R, R, O, O,
R, R, R, R, R, R, R, O,
O, R, R, R, R, R, O, O,
O, O, R, R, R, O, O, O,
O, O, O, R, O, O, O, O,
]
return logo
while True:
for get_image in [diamond, spade, heart, clubs]:
s.set_pixels(get_image())
time.sleep(.75)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment