Skip to content

displayio API updates #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions adafruit_simple_text_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
try:
from typing import Optional, Tuple

import busdisplay
from fontio import FontProtocol
except ImportError:
pass
Expand Down Expand Up @@ -72,7 +73,7 @@ def __init__(
text_scale: int = 1,
font: Optional[FontProtocol] = None,
colors: Optional[Tuple[Tuple[int, int, int], ...]] = None,
display: Optional[displayio.Display] = None,
display: Optional[busdisplay.BusDisplay] = None,
) -> None:
"""Display lines of text on a display using displayio. Lines of text are created in order as
shown in the example below. If you skip a number, the line will be shown blank on the
Expand Down Expand Up @@ -107,9 +108,9 @@ def __init__(
library. For example, if you import the library as
``from adafruit_simple_text_display import SimpleTextDisplay``, you can indicate the
colors as follows: ``colors=(SimpleTextDisplay.WHITE, SimpleTextDisplay.RED)``.
:param ~displayio.Display|None display: The display object. Defaults to assuming a built-in
display. To use with an external display, instantiate the display object and provide it
here. Defaults to ``board.DISPLAY``.
:param ~busdisplay.BusDisplay|None display: The display object. Defaults to assuming
a built-in display. To use with an external display, instantiate the display
object and provide it here. Defaults to ``board.DISPLAY``.

This example displays two lines with temperature data in C and F on the display.
Remember to call `show()` after the list to update the display.
Expand Down