A simple electronic cheat sheet with a graphical interface powered by the Waveshare ESP32-C6 microcontroller and LVGL library.
- MCU: Waveshare ESP32-C6-LCD-1.47 (RISC-V, 1.47" TFT 172x320).
- Controls: 2 tactile buttons.
- Storage: MicroSD Card (formatted FAT32).
- Pinout:
- Button 1 (Prev/Select):
GPIO 0↔GND - Button 2 (Next/Back):
GPIO 1↔GND - Note: The code uses
INPUT_PULLUP, so external resistors are not required.
- Button 1 (Prev/Select):
- IDE: Arduino IDE (v2.x+).
- UI Framework: LVGL (Light and Versatile Graphics Library).
- UI Builder: SquareLine Studio.
- Libraries:
lvglEncButton(for button handling)SD(Standard Arduino SD library)- Driver libraries (usually included in the project folder like
Display_ST7789.h).
-
Arduino IDE Setup:
- Install ESP32 Board support (version 3.0.0+ is required for C6).
- Select Board:
ESP32C6 Dev Module. - Tools Menu Configuration: Configure the board settings exactly as follows:
- USB CDC On Boot:
Disabled - CPU Frequency:
160MHz (WiFi) - Core Debug Level:
None - Erase All Flash:
Disabled - Flash Frequency:
80MHz - Flash Mode:
QIO - Flash Size:
4MB (32Mb) - Partition Scheme:
Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) - Upload Speed:
921600 - Zigbee Mode:
Disabled
- USB CDC On Boot:
-
Dependencies: Install
EncButtonandlvglvia the Arduino Library Manager. Ensure local project files (Display_ST7789.h,SD_Card.h,ui.h, etc.) are in the sketch folder. -
SD Card:
- Format a MicroSD card to FAT32.
- Create
.txtfiles in the root directory. - Insert the card into the slot.
-
Flashing:
- Connect the device via USB.
- Hold the
BOOTbutton (GPIO 0) while pressingRESETto enter Download Mode if automatic upload fails. - Upload the sketch.
| Button | Action | Function in Menu | Function in Reading Mode |
|---|---|---|---|
| GPIO 0 (Left) | Click | Scroll Up / Previous File | Previous Page/Fragment |
| GPIO 0 (Left) | Hold | Return to Menu | Return to Menu |
| GPIO 1 (Right) | Click | Scroll Down / Next File | Next Page/Fragment |
| GPIO 1 (Right) | Hold | Open Selected File | (No action / Reload) |
- Text Format: The reader expects standard
.txtfiles. - Pagination: The reader splits long lines into 400-character chunks to fit the small screen.
- GPIO 0 Conflict: Since GPIO 0 is also the Boot strap pin, ensure the button is not pressed when powering on or resetting the device, otherwise, it will enter bootloader mode instead of running your code.
Author: Pundemia Date: 2025