Update heart.py

This commit is contained in:
jimmy 2023-04-21 11:42:29 +12:00
parent 537db91acc
commit d709a545d7
1 changed files with 26 additions and 6 deletions

View File

@ -3,11 +3,31 @@ import time
ws = WS2812B(256, 28, 0.2)
array = [[ws.RED, ws.BLACK, ws.BLACK, ws.BLACK],
[ws.BLACK, ws.BLACK, ws.BLACK, ws.BLACK],
[ws.BLACK, ws.BLACK, ws.BLACK, ws.BLACK],
[ws.BLACK, ws.BLACK, ws.BLACK, ws.BLACK]]
array = [
[ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK],
[ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK],
[ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK],
[ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK],
[ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK],
[ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK],
[ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK],
[ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK],
[ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK],
[ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK],
[ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK],
[ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK],
[ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK],
[ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK],
[ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK],
[ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK, ws.RED, ws.BLACK, ws.BLACK, ws.BLACK],
]
for i in range(4):
ws.pixels_set(i, array[i][0])
for i in range(16):
if i % 2 == 1:
array[i] = array[i][::-1]
array = [elem for row in array for elem in row]
for i in range(256):
ws.pixels_set(i, array[i])
ws.pixels_show()