2021-01-21 16:56:04 +00:00
|
|
|
import time
|
2023-03-13 19:39:33 +00:00
|
|
|
from picoscroll import PicoScroll, WIDTH, HEIGHT
|
|
|
|
|
|
|
|
scroll = PicoScroll()
|
2021-01-21 16:56:04 +00:00
|
|
|
|
|
|
|
i = 0
|
|
|
|
loop = 18
|
|
|
|
br_mult = 1
|
|
|
|
br_pressed = 32
|
|
|
|
tail = 12
|
|
|
|
|
|
|
|
while True:
|
2021-04-15 09:21:27 +01:00
|
|
|
scroll.clear()
|
2023-03-13 19:39:33 +00:00
|
|
|
for y in range(0, HEIGHT):
|
|
|
|
for x in range(0, WIDTH):
|
2021-01-21 16:56:04 +00:00
|
|
|
if x < 3 and y < 3 and scroll.is_pressed(scroll.BUTTON_A):
|
|
|
|
scroll.set_pixel(x, y, br_pressed)
|
|
|
|
elif x < 3 and y > 3 and scroll.is_pressed(scroll.BUTTON_B):
|
|
|
|
scroll.set_pixel(x, y, br_pressed)
|
2023-03-13 19:39:33 +00:00
|
|
|
elif x > WIDTH - 4 and y < 3 and scroll.is_pressed(scroll.BUTTON_X):
|
2021-01-21 16:56:04 +00:00
|
|
|
scroll.set_pixel(x, y, br_pressed)
|
2023-03-13 19:39:33 +00:00
|
|
|
elif x > WIDTH - 4 and y > 3 and scroll.is_pressed(scroll.BUTTON_Y):
|
2021-01-21 16:56:04 +00:00
|
|
|
scroll.set_pixel(x, y, br_pressed)
|
|
|
|
else:
|
2023-03-13 19:39:33 +00:00
|
|
|
m = (x + (y * WIDTH)) % loop
|
2021-01-21 16:56:04 +00:00
|
|
|
for b in range(0, loop):
|
|
|
|
if m == (i + (loop - b)) % loop and b < tail:
|
|
|
|
scroll.set_pixel(x, y, br_mult * (tail - b))
|
|
|
|
|
2023-03-21 14:24:03 +00:00
|
|
|
scroll.show()
|
2021-01-21 16:56:04 +00:00
|
|
|
i += 1
|
|
|
|
if i >= loop:
|
|
|
|
i = 0
|
|
|
|
time.sleep(0.02)
|