|
LCDGFX LCD display driver
1.2.0
Lightweight graphics library for SSD1306, SSD1325, SSD1327, SSD1331, SSD1351, SH1106, SH1107, IL9163, ST7735, ST7789, ILI9341, PCD8544 displays over I2C/SPI
|
LCDGFX is a lightweight C++ graphics library for LCD and OLED displays, designed to run on resource-constrained microcontrollers (as small as ATtiny85 with 512 bytes of RAM) as well as powerful platforms like ESP32 and Raspberry Pi.
The library provides:
Install via the Arduino Library Manager:
Or manually:
Add to your platformio.ini:
For Raspberry Pi GPIO support (kernel 6.6+), install libgpiod:
Here is a minimal example that draws text on an SSD1306 OLED display over I2C:
For SPI-connected displays like the ST7735:
Each supported display has pre-defined classes following the naming pattern:
Examples:
DisplaySSD1306_128x64_I2C — SSD1306 128×64 monochrome over I2CDisplaySSD1306_128x64_SPI — SSD1306 128×64 monochrome over SPIDisplayST7789_240x240x16_SPI — ST7789 240×240 16-bit color over SPIDisplayILI9341_240x320x16_SPI — ILI9341 240×320 16-bit color over SPIFor a full list, see Display Selection Guide.
All display objects inherit common drawing functions:
For monochrome displays, use display.setColor(0xFF) for white and display.setColor(0x00) for black.
Available built-in fonts are listed in FONTS: Supported LCD fonts.