mirror of
https://gitlab1.ptb.de/waltem01/Matrix
synced 2024-11-09 15:03:49 +00:00
30 lines
783 B
Python
30 lines
783 B
Python
#!/usr/bin/env python
|
|
from deps.samplebase import SampleBase
|
|
from rgbmatrix import graphics
|
|
import time
|
|
|
|
|
|
class Test(SampleBase):
|
|
def __init__(self, *args, **kwargs):
|
|
super(Test, self).__init__(*args, **kwargs)
|
|
self.parser.add_argument("-t", "--text", help="The text to scroll on the RGB LED panel", default="Hello world!")
|
|
|
|
def run(self):
|
|
offscreen_canvas = self.matrix.CreateFrameCanvas()
|
|
font = graphics.Font()
|
|
font.LoadFont("deps/fonts/9x18B.bdf")
|
|
text_color = graphics.Color(255, 255, 255)
|
|
|
|
offscreen_canvas.Clear()
|
|
graphics.DrawText(offscreen_canvas, font, 0, 18, text_color, self.args.text)
|
|
self.matrix.SwapOnVSync(offscreen_canvas)
|
|
|
|
while True:
|
|
time.sleep(0.05)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
test = Test()
|
|
if not test.process():
|
|
test.print_help()
|