Skip to content

Commit 957335c

Browse files
authored
Merge pull request adafruit#96 from FoamyGuy/add_matrixportal_example
Add matrixportal example
2 parents 0c57ae8 + 856e6d2 commit 957335c

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

examples/display_text_matrixportal.py

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
"""
2+
This example shows how to create a display_text label and show it
3+
with a Matrix Portal
4+
5+
Requires:
6+
adafruit_matrixportal - https://github.com/adafruit/Adafruit_CircuitPython_MatrixPortal
7+
8+
Copy it from the current libraries bundle into the lib folder on your device.
9+
"""
10+
import terminalio
11+
from adafruit_matrixportal.matrix import Matrix
12+
from adafruit_display_text import label
13+
14+
matrix = Matrix()
15+
display = matrix.display
16+
17+
text = "Hello\nworld"
18+
text_area = label.Label(terminalio.FONT, text=text)
19+
text_area.x = 1
20+
text_area.y = 4
21+
display.show(text_area)
22+
while True:
23+
pass

0 commit comments

Comments
 (0)