Last active
August 11, 2020 03:58
-
-
Save Sandyman/775fae91b18aede722772691189a2d95 to your computer and use it in GitHub Desktop.
Default sensehat code with a few extra icons
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
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