Skip to content

Instantly share code, notes, and snippets.

@Akkiesoft
Created November 17, 2014 22:39
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 Akkiesoft/c61078527f67eac8b26e to your computer and use it in GitHub Desktop.
Save Akkiesoft/c61078527f67eac8b26e to your computer and use it in GitHub Desktop.
UNICORN HATでミクさんを出すやつ
#!/usr/bin/env python
import unicornhat as UH
import time
data = [
'01000010',
'81888818',
'87887888',
'87787788',
'87778778',
'87677678',
'87777778',
'87733778'
]
# 0 = #000000
# 1 = #7d074b
# 3 = #b83e3e
# 6 = #0000ff
# 7 = #efe8a4
# 8 = #3eb8a5
for y in range(8):
for x in range(8):
c = data[y][x]
r = 0
g = 0
b = 0
if c == '1':
r = 125
g = 7
b = 75
elif c == '3':
r = 182
g = 62
b = 62
elif c == '6':
b = 255
elif c == '7':
r = 239
g = 232
b = 164
elif c == '8':
r = 62
g = 184
b = 165
UH.set_pixel(x,y,r,g,b)
UH.show()
while True:
time.sleep(5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment