@@ -37,18 +37,8 @@ or individual libraries can be installed using
3737`circup <https://github.com/adafruit/circup >`_.
3838
3939
40-
41- .. todo :: Describe the Adafruit product this library works with. For PCBs, you can also add the
42- image from the assets folder in the PCB's GitHub repo.
43-
44- `Purchase one from the Adafruit shop <http://www.adafruit.com/products/ >`_
45-
4640Installing from PyPI
4741=====================
48- .. note :: This library is not available on PyPI yet. Install documentation is included
49- as a standard element. Stay tuned for PyPI availability!
50-
51- .. todo :: Remove the above note if PyPI version is/will be available at time of release.
5242
5343On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
5444PyPI <https://pypi.org/project/adafruit-circuitpython-color-terminal/> `_.
@@ -99,8 +89,52 @@ Or the following command to update an existing version:
9989 Usage Example
10090=============
10191
102- .. todo :: Add a quick, simple example. It and other examples should live in the
103- examples folder and be included in docs/examples.rst.
92+ .. code-block :: python
93+
94+ import supervisor
95+ from displayio import Group
96+ from terminalio import FONT
97+
98+ from adafruit_color_terminal import ColorTerminal
99+
100+ main_group = Group()
101+ display = supervisor.runtime.display
102+ font_bb = FONT .get_bounding_box()
103+ screen_size = (display.width // font_bb[0 ], display.height // font_bb[1 ])
104+
105+ terminal = ColorTerminal(FONT , screen_size[0 ], screen_size[1 ])
106+ main_group.append(terminal.tilegrid)
107+
108+ black = chr (27 ) + " [30m"
109+ red = chr (27 ) + " [31m"
110+ green = chr (27 ) + " [32m"
111+ yellow = chr (27 ) + " [33m"
112+ blue = chr (27 ) + " [34m"
113+ magenta = chr (27 ) + " [35m"
114+ cyan = chr (27 ) + " [36m"
115+ white = chr (27 ) + " [37m"
116+ reset = chr (27 ) + " [0m"
117+
118+
119+ message = f " Hello { green} World { reset} { yellow} ANSI \n "
120+ terminal.write(message)
121+ print (message, end = " " )
122+
123+ message = f " { magenta} Terminal { red} Colors { reset} "
124+ terminal.write(message)
125+ print (message)
126+
127+ display.root_group = main_group
128+
129+ print (terminal.cursor_x, terminal.cursor_y)
130+
131+ move_cursor = chr (27 ) + " [10;10H"
132+ terminal.write(f " Something { move_cursor}{ cyan} Else { reset} " )
133+ print (f " Something { move_cursor}{ cyan} Else { reset} " )
134+
135+ while True :
136+ pass
137+
104138
105139 Documentation
106140=============
0 commit comments