diff --git a/src/matrix.py b/src/matrix.py index eb9e660..dcef105 100644 --- a/src/matrix.py +++ b/src/matrix.py @@ -9,8 +9,9 @@ from luma.core.legacy.font import proportional, CP437_FONT, LCD_FONT class MatrixDisplay: - def __init__(self, *, contrast=0) -> None: + def __init__(self, *, contrast=0, text_speed=0.02) -> None: self.contrast = contrast + self.text_speed = text_speed self.serial = spi(port=0, device=0, gpio=noop()) self.device = max7219( self.serial, width=32, height=8, rotate=2, block_orientation=-90 @@ -28,7 +29,7 @@ class MatrixDisplay: for offset in range(width): virtual.set_position((offset, 0)) - time.sleep(0.015) + time.sleep(self.text_speed) def flash(self, count=1): self.device.contrast(255)