-
Notifications
You must be signed in to change notification settings - Fork 0
Example Buttons
Nick Tracy edited this page Jul 18, 2026
·
3 revisions
Goal: Move between two on-screen buttons with the keyboard, toggle the built-in LED, and optionally click with a mouse.
This is the best example for learning real interaction.
- Upload ButtonsExample.
- Terminal at 9600 baud.
- Watch the board’s built-in LED (usually next to pin 13 on classic Arduinos).
- Title: Button interaction example
- Two controls: Toggle LED and Exit (one highlighted)
- Hints about keyboard and mouse
- Status line when the LED changes (
LED is ON/OFF)
| Key / action | Result |
|---|---|
| ↑ / ↓ / ← / → | Move the highlight |
| Enter | Activate the highlighted button |
| Mouse click on a button | Activate that button (only if the terminal sends mouse reports) |
Toggle LED flips the onboard LED. Exit clears the screen and prints Goodbye.
PuTTY over a USB serial port usually cannot click buttons. Use the arrow keys and Enter — the sketch is written for that.
- If arrows do nothing, confirm the terminal is focused and not capturing keys for its own menus.
- After Exit, upload again (or reset the board) to restart the sketch.
ANSITerm is open source under the LGPL-3.0 license. · Repository · Issues