forked from hzeller/rpi-rgb-led-matrix
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpattern.py
More file actions
33 lines (26 loc) · 858 Bytes
/
pattern.py
File metadata and controls
33 lines (26 loc) · 858 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
#!/usr/bin/env python
from samplebase import SampleBase
from rgbmatrix import graphics
import time
class GraphicsTest(SampleBase):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
def run(self):
canvas = self.matrix
red = graphics.Color(255, 0, 0)
green = graphics.Color(0, 255, 0)
blue = graphics.Color(0, 0, 255)
white = graphics.Color(255, 255, 255)
OFFSET = 2
for x in range(0, canvas.width, 5):
graphics.DrawLine(canvas, x + OFFSET, 0, x + OFFSET, canvas.height, blue)
try:
while True:
time.sleep(100)
except KeyboardInterrupt:
pass
# Main function
if __name__ == "__main__":
graphics_test = GraphicsTest()
if (not graphics_test.process()):
graphics_test.print_help()