From 856e6d286015c922bbf5903d5471d7341b9a4e0a Mon Sep 17 00:00:00 2001 From: foamyguy Date: Fri, 6 Nov 2020 09:38:29 -0600 Subject: [PATCH] adding matrix portal example --- examples/display_text_matrixportal.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 examples/display_text_matrixportal.py diff --git a/examples/display_text_matrixportal.py b/examples/display_text_matrixportal.py new file mode 100644 index 0000000..c54c0e5 --- /dev/null +++ b/examples/display_text_matrixportal.py @@ -0,0 +1,23 @@ +""" +This example shows how to create a display_text label and show it +with a Matrix Portal + +Requires: +adafruit_matrixportal - https://github.com/adafruit/Adafruit_CircuitPython_MatrixPortal + +Copy it from the current libraries bundle into the lib folder on your device. +""" +import terminalio +from adafruit_matrixportal.matrix import Matrix +from adafruit_display_text import label + +matrix = Matrix() +display = matrix.display + +text = "Hello\nworld" +text_area = label.Label(terminalio.FONT, text=text) +text_area.x = 1 +text_area.y = 4 +display.show(text_area) +while True: + pass