-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathpalettes_wheel.py
More file actions
35 lines (24 loc) · 903 Bytes
/
palettes_wheel.py
File metadata and controls
35 lines (24 loc) · 903 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from board_config import display_drv
from palettes import get_palette
# If byte swapping is required and the display bus is capable of having byte swapping disabled,
# disable it and set a flag so we can swap the color bytes as they are created.
if display_drv.requires_byteswap:
needs_swap = display_drv.disable_auto_byteswap(True)
else:
needs_swap = False
display_drv.rotation = 0
palette = get_palette(name="wheel", swapped=needs_swap, length=256, saturation=1.0)
# palette = get_palette(name="wheel", color_depth=16, length=256)
line_height = 2
i = 0
def main():
global i
for color in palette:
if i >= display_drv.height:
display_drv.vscsad((line_height + i) % display_drv.height)
display_drv.fill_rect(0, i % display_drv.height, display_drv.width, line_height, color)
i += line_height
def loop():
while True:
main()
loop()