Skip to content

Using the Examples

github-actions[bot] edited this page Jul 18, 2026 · 3 revisions

Using the Examples

Every example lives under File → Examples → ANSITerm in the Arduino IDE after the library is installed.

Suggested learning path

Basic → Advanced → Buttons → Graphic
                    ↘ ANS files (needs SD card + Mega-class RAM)
Network / ESP examples when you have Wi‑Fi or Ethernet
Order Example What you learn Extra hardware
1 Basic Colors, box, button USB only
2 Advanced Tables, symbols, animation USB only; wider window (~70 columns)
3 Buttons Menus with keyboard + mouse USB only; onboard LED
4 Graphic Game loop, WASD keys USB only
5 ANS files SD card file list SD module; best on Mega
6 Network terminal UI over TCP Wi‑Fi or Ethernet
7 ESP Wi‑Fi control Dual Serial + network dashboard ESP32 or ESP8266

Shared tips for all examples

  1. Upload first, then open the terminal — do not leave the Serial Monitor open.
  2. Match the baud rate in the sketch header / Serial.begin(...).
  3. Prefer a UTF-8 terminal (guide).
  4. If the screen goes blank after you unplug/replug USB on Leonardo-style boards, many demos redraw automatically.
  5. Examples that wait for a click also accept Enter or Space where noted.

Which board should I use?

  • Uno / Leonardo — Basic, Advanced, Buttons, Graphic.
  • Mega — All of the above plus ANS files (more memory).
  • ESP32 / ESP8266 — Network terminal + ESP Wi‑Fi control (and the Serial demos too).

Official compile coverage is listed in the README.

Customizing an example

  1. Open the example.
  2. Use File → Save As… so you edit a copy in your sketchbook (not the library copy).
  3. Change colors, text, or button labels.
  4. Upload and test again.

When you are ready to write your own sketch from scratch, start from Basic or Buttons and keep the pattern: Serial.beginterminal.begin → draw → read input in a loop.

What the examples look like

Example Preview
BasicExample basic
AdvancedExample advanced
ButtonsExample buttons
GraphicExample graphic
ANSFileExample ansfile
NetworkTerminalExample network
ESPWiFiControlExample esp

Clone this wiki locally