Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
Supported ESP SoCs ESP32 ESP32-C3 ESP32-C6 ESP32-H2 ESP32-S2 ESP32-S3 ESP32-P4
Supported LCD Controllers AXS15231B GC9A01 GC9B71 ILI9341 NV3022B SH8601 SPD2010 ST7789 ST7796 ST77916 ST77922

SPI LCD Example

Overview

This example demonstrates how to drive different model LCDs with SPI interface bus and test them by displaying color bars.

How to Use

Step 1. Install SDK and dependencies

Step 2. Configure the libraries

  • [Optional] ESP32_Display_Panel:

  • [Optional] esp-lib-utils :

Step 3. Configure the example

  • [Mandatory] Edit the macro definitions in the lcd_spi.ino file

Step 4. Configure Arduino IDE

  • Navigate to the Tools menu
  • Select the target board in the Board menu
  • Change the USB CDC On Boot option to Enabled if using USB port, or Disabled if using UART port. If this configuration differs from previous flashing, first enable Erase All Flash Before Sketch Upload, then it can be disabled after flashing.
  • Change other configurations as needed
  • see Configuring Arduino IDE for more information

Step 5. Compile and upload the project

  • Connect the board to your computer
  • Select the correct serial port
  • Click the upload button

Step 6. Check the serial output

  • Open the serial monitor and select the correct baud rate (like 115200)
  • Check the output logs

Serial Output

The following are the logs output when using the ILI9341 LCD. The logs content may vary with different LCDs or different configurations, and it is provided for reference only.

...
Initializing backlight and turn it off
Initializing "SPI" LCD with config
[I][Panel][esp_lcd_ili9341.c:0061](esp_lcd_new_panel_ili9341): version: 2.0.0
Draw color bar from top left to bottom right, the order is B - G - R
LCD draw finish callback
LCD draw finish callback
LCD draw finish callback
LCD draw finish callback
LCD draw finish callback
LCD draw finish callback
LCD draw finish callback
LCD draw finish callback
LCD draw finish callback
LCD draw finish callback
LCD draw finish callback
LCD draw finish callback
LCD draw finish callback
LCD draw finish callback
LCD draw finish callback
LCD draw finish callback
Turn on the backlight
IDLE loop
IDLE loop
...

Troubleshooting

Please check the FAQ first to see if the same question exists. If not, please create a Github Issue. We will get back to you as soon as possible.