-
-
Save TristanAmond/f0c6f403ab8658cce718937c76562fab to your computer and use it in GitHub Desktop.
basic driver for MatrixPortal M4 LED panel project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import displayio | |
import terminalio | |
from adafruit_display_text.label import Label | |
from adafruit_bitmap_font import bitmap_font | |
# Initialize display_manager class | |
class display_manager(displayio.Group): | |
def __init__( | |
self, | |
display, | |
): | |
super().__init__() | |
self.display = display | |
# set up label groups | |
self.root_group = displayio.Group() | |
self.root_group.append(self) | |
self._label_group = displayio.Group(x=4, y=8) | |
self.append(self._label_group) | |
# set up text label | |
self.label_text = Label(terminalio.FONT) | |
self.label_text.color = 0xFFFFFF | |
self._label_group.append(self.label_text) | |
# update text in the text label | |
def update_label(self, input_text): | |
self.label_text.text = input_text | |
# refresh the root group on the display | |
def refresh_display(self): | |
self.display.show(self.root_group) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment