Skip to content

Examples

All examples are located in the examples/ directory. Each .ino file is a complete, self-contained Arduino sketch.


Basic

button/button.ino

Demonstrates physical button A (M5Cardputer.BtnA). Prints a message to the display on each press.


display/display.ino

Basic LCD drawing: fill screen, draw text, shapes, and colors using M5GFX.


buzzer/buzzer.ino

Speaker tone generation using M5Cardputer.Speaker.tone(). Plays different frequencies.


mic/mic.ino

Microphone recording with M5Cardputer.Mic. Captures audio and displays waveform.


mic_wav_record/mic_wav_record.ino

Records microphone input to a WAV file on the SD card.


sdcard/sdcard.ino

SD card read/write operations: file creation, writing, reading, directory listing.


ir_nec/ir_nec.ino

IR transmitter using NEC protocol (requires IRremote library).


Keyboard (keyboard/)

Example Description
singlePress/singlePress.ino Detect single key presses using isChange() + isPressed()
multiPress/multiPress.ino Handle multiple simultaneous key presses
inputText/inputText.ino Text input with editing (type, display, backspace support)
usbKeyboard/usbKeyboard.ino USB HID keyboard emulation — turns the M5Cardputer into a USB keyboard

Advanced

SSHClient/SSHClient.ino

SSH client using WiFi + keyboard input (requires LibSSH-ESP32).


UI

REPL/REPL.ino

Interactive number-guessing game built on the ReplView UI framework. Demonstrates keyboard-driven terminal-style UI with prompts, command history, and message display.