-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
42 lines (37 loc) · 1.12 KB
/
main.py
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
36
37
38
39
40
41
42
#!/usr/bin/env python
# Main python
# imports - use the rpi-rgb-led-matrix instructions to install dependencies
from rgbmatrix import RGBMatrix
from rgbmatrix import RGBMatrixOptions
from kabuki import Kabuki
ROWS = 16
COLS = 32
if __name__ == "__main__":
# Configuration for the matrix, adafruit hat in a U configuration, 2 chain
options = RGBMatrixOptions()
options.rows = ROWS
options.cols = COLS
options.chain_length = 2
options.pixel_mapper_config = "U-mapper"
options.gpio_slowdown = 4
options.hardware_mapping = "adafruit-hat"
options.drop_privileges = 0
#options.show_refresh_rate = 1
print(
"Starting Kabuki with",
str(options.rows),
"rows",
str(options.cols),
"cols",
str(options.pixel_mapper_config),
str(options.hardware_mapping),
)
matrix = RGBMatrix(options=options)
try:
kabuki = Kabuki(matrix)
except KeyboardInterrupt:
matrix.Clear()
print("Ctrl+C pressed, exiting")
raise
except Exception as e:
print("Exception: ", e)