Google Chat: zj734465502@gmail.com
+86-0755-88291180
sales@spotpear.com
dragon_manager@163.com
tech-support@spotpear.com
zhoujie@spotpear.com
WhatsApp:13246739196
The ESP32-C6-Touch-AMOLED-1.8 is a high-performance, highly integrated microcontroller development board designed by Waveshare. It is equipped with a 1.8inch capacitive high-definition AMOLED screen, a highly integrated Power Management Unit (PMU), a 6-axis IMU (3-axis accelerometer and 3-axis gyroscope), a RTC, a low-power audio codec chip and other peripherals in a smaller board size, which are convenient for development and embedding into the product.



The ESP32-C6-Touch-AMOLED-1.8 supports two development frameworks: Arduino IDE and ESP-IDF, providing flexibility for developers to choose the tool that best fits their project requirements and personal preference.
Each method has its advantages, and developers can select based on their needs and skill level. Arduino is simple to learn and easy to get started with, suitable for beginners and non-professionals; ESP-IDF provides more advanced development tools and stronger control capabilities, suitable for developers with professional backgrounds or those with higher performance requirements, and is more suitable for complex project development.
Arduino IDE is a convenient, flexible, and easy-to-use open-source electronics prototyping platform. It requires minimal foundational knowledge, allowing for rapid development after a short learning period. Arduino has a vast global community that provides a wealth of open-source code, project examples, tutorials, and rich libraries that encapsulate complex functionalities, enabling developers to implement various features quickly. You can refer to the Working with Arduino to complete the initial setup, and the tutorial also provides related demos for reference.
ESP-IDF (Espressif IoT Development Framework) is a professional development framework released by Espressif for its ESP series chips. It is developed based on the C language, including a compiler, debugger, and flashing tool, etc. It supports development via command line or an Integrated Development Environment (such as Visual Studio Code with the Espressif IDF plugin), which provides features like code navigation, project management, and debugging, etc. We recommend using VS Code for development. For the specific configuration process, please refer to the Working with ESP-IDF. The tutorial also provides relevant demos for reference.
Note: This tutorial uses the ESP32-S3-Zero as a reference example, and all hardware code is based on its pinout. Before you start, we recommend checking the pinout of your development board to ensure the pin configuration is correct.
Please refer to the tutorial Installing and Configuring Arduino IDE Tutorial to download and install the Arduino IDE and add ESP32 support.
Arduino directory. The Arduino\libraries directory within the package already includes all the library files required for this tutorial.| Library/File Name | Description | Version | Installation Method |
|---|---|---|---|
| GFX Library for Arduino | ST7789 display driver graphics library | v1.6.4 | Install via library manager or manually |
| SensorLib | PCF85063, QMI8658 sensor driver library | v0.3.3 | Install via library manager or manually |
| XPowersLib | AXP2101 driver library | v0.2.6 | Install via library manager or manually |
| lvgl | LVGL display framework | v8.4.0 | Install via library manager or manually |
| Arduino_DriveBus | I2C, touch driver library | v1.0.1 | Install manually |
| Adafruit_BusIO | Abstracted I2C/SPI communication | v1.0.1 | Install via library manager or manually |
| Adafruit_XCA9554 | I2C GPIO expander library | v1.0.1 | Install via library manager or manually |
| Mylibrary | Board pin macro definition | —— | Install manually |
| ui_a | Custom UI library | —— | Install manually |
| ui_b | Custom UI library | —— | Install manually |
| ui_c | Custom UI library | —— | Install manually |
| lv_conf.h | LVGL configuration file | —— | Install manually |
There are strong dependencies between versions of LVGL and its driver libraries. For example, a driver written for LVGL v8 may not be compatible with LVGL v9. To ensure stable reproduction of the examples, it is recommended to use the specific versions listed in the table above. Mixing different library versions may cause compilation failures or runtime exceptions.
Installation Steps:
Download the demo package.
Copy all folders (Arduino_DriveBus, GFX_Library_for_Arduino, etc.) in the Arduino\libraries directory to the Arduino library folder.
The path to the Arduino libraries folder is typically: c:\Users\<Username>\Documents\Arduino\libraries.
You can also locate it within the Arduino IDE via File > Preferences, by checking the "Sketchbook location". The library folder is the libraries folder under this path.
For other installation methods, please refer to: Arduino Library Management Tutorial.
The Arduino demos are located in the Arduino/examples directory of the demo package.
| Demo | Basic Program Description | Dependency Library |
|---|---|---|
| 01_HelloWorld | Demonstrates the basic graphics library function and can also be used to test the basic performance of display screens and the display effect of random text | GFX_Library_for_Arduino |
| 02_Drawing_board | Demonstrates the basic graphics library functions and can also be used to test the basic performance of display screens and the display effect of random text | GFX_Library_for_Arduino, Arduino_DriveBus, Adafruit_XCA9554 |
| 03_GFX_AsciiTable | Prints ASCII characters in rows and columns on the screen according to the screen size | GFX_Library_for_Arduino |
| 04_GFX_FT3168_Image | Shows image display effects, switching displayed images via touch | GFX_Library_for_Arduino, Arduino_DriveBus, Adafruit_XCA9554 |
| 05_GFX_PCF85063_simpleTime | GFX library displays the current time | SensorLib, GFX_Library_for_Arduino |
| 06_GFX_ESPWiFiAnalyzer | Draws WiFi band signal strength on the screen | GFX_Library_for_Arduino |
| 07_GFX_Clock | Implements a clock using simple marker pointers and time management | GFX_Library_for_Arduino |
| 08_LVGL_Animation | Custom UI to control backlight brightness | LVGL, Arduino_DriveBus, ui_a |
| 09_LVGL_change_background | Custom UI to control background colorbrightness | LVGL, Arduino_DriveBus, ui_b |
| 10_LVGL_PCF85063_simpleTime | LVGL library displays the current time | LVGL, SensorLib |
| 11_LVGL_QMI8658_ui | LVGL draws an acceleration line chart | LVGL, SensorLib |
| 12_LVGL_Widgets | LVGL demonstration | LVGL, Arduino_DriveBus, Adafruit_XCA9554 |
| 13_ES8311 | ES8311 driver example, plays simple audio | —— |
| 14_LVGL_Sqprj | SquareLine UI combined with LVGL example | LVGL |

Display initialization:
if (!gfx->begin()) {
USBSerial.println("gfx->begin() failed!");
}
Clear the screen and display text:
gfx->fillScreen(BLACK);
gfx->setCursor(10, 10);
gfx->setTextColor(RED);
gfx->println("Hello World!");
Animated display:
gfx->setCursor(random(gfx->width()), random(gfx->height()));
gfx->setTextColor(random(0xffff), random(0xffff));
gfx->setTextSize(random(6), random(6), random(2));
gfx->println("Hello World!");

Display initialization and brightness fade animation:
gfx->begin();
gfx->fillScreen(WHITE);
for(int i = 0;i <= 255;i++){
gfx->Display_Brightness(i);
gfx->setCursor(30, 150);
gfx->setTextColor(BLUE);
gfx->setTextSize(4);
gfx->println("Loading board");
delay(3);
}
Touch interrupt handling and coordinate reading:
gfx->fillScreen(BLACK);
gfx->setCursor(10, 10);
gfx->setTextColor(RED);
gfx->println("Hello World!");
Animated display:
void Arduino_IIC_Touch_Interrupt(void) {
FT3168->IIC_Interrupt_Flag = true;
}
int32_t touchX = FT3168->IIC_Read_Device_Value(FT3168->Arduino_IIC_Touch::Value_Information::TOUCH_COORDINATE_X);
int32_t touchY = FT3168->IIC_Read_Device_Value(FT3168->Arduino_IIC_Touch::Value_Information::TOUCH_COORDINATE_Y);
if (FT3168->IIC_Interrupt_Flag == true) {
FT3168->IIC_Interrupt_Flag = false;
USBSerial.printf("Touch X:%d Y:%d\n", touchX, touchY);
if (touchX > 20 && touchY > 20) {
gfx->fillCircle(touchX, touchY, 5, BLUE);
}
}

Create data bus and graphic display objects
bus is created for communicating with the display, initialized with specific pin configurations. Then a graphics display object gfx is created, passing parameters such as the data bus, reset pin, rotation angle, whether it is an IPS panel, and the width and height of the display Arduino_DataBus *bus = new Arduino_ESP32QSPI(
LCD_CS /* CS */, LCD_SCLK /* SCK */, LCD_SDIO0 /* SDIO0 */, LCD_SDIO1 /* SDIO1 */,
LCD_SDIO2 /* SDIO2 */, LCD_SDIO3 /* SDIO3 */);
Arduino_GFX *gfx = new Arduino_SH8601(bus, -1 /* RST */,
0 /* rotation */, false /* IPS */, LCD_WIDTH, LCD_HEIGHT);
Draw row and column numbers and character table
gfx->setTextColor(GREEN);
for (int x = 0; x < numRows; x++) {
gfx->setCursor(10 + x * 8, 2);
gfx->print(x, 16);
}
gfx->setTextColor(BLUE);
for (int y = 0; y < numCols; y++) {
gfx->setCursor(2, 12 + y * 10);
gfx->print(y, 16);
}
char c = 0;
for (int y = 0; y < numRows; y++) {
for (int x = 0; x < numCols; x++) {
gfx->drawChar(10 + x * 8, 12 + y * 10, c++, WHITE, BLACK);
}
}

if (fingers_number > 0) {
switch (Image_Flag) {
case 0: gfx->draw16bitRGBBitmap(0, 0, (uint16_t *)gImage_1, LCD_WIDTH, LCD_HEIGHT); break;
case 1: gfx->draw16bitRGBBitmap(0, 0, (uint16_t *)gImage_2, LCD_WIDTH, LCD_HEIGHT); break;
case 2: gfx->draw16bitRGBBitmap(0, 0, (uint16_t *)gImage_3, LCD_WIDTH, LCD_HEIGHT); break;
case 3: gfx->draw16bitRGBBitmap(0, 0, (uint16_t *)gImage_4, LCD_WIDTH, LCD_HEIGHT); break;
case 4: gfx->draw16bitRGBBitmap(0, 0, (uint16_t *)gImage_5, LCD_WIDTH, LCD_HEIGHT); break;
}
Image_Flag++;
if (Image_Flag > 4) {
Image_Flag = 0;
}
}
![]() | ![]() | ![]() |
|---|
setup: Performs demo initialization settings
loop: Continuously checks for time changes and updates the time display on the screen during program execution
setup: Prepares for the initialization of the entire program
loop: Executes the main program logic, including performing WiFi network scanning, processing scan results, drawing charts and displaying statistical information, and performing power-saving operations as needed

void redraw_hands_cached_draw_and_erase() {
gfx->startWrite();
draw_and_erase_cached_line(center, center, nsx, nsy, SECOND_COLOR, cached_points, sHandLen + 1, false, false);
draw_and_erase_cached_line(center, center, nhx, nhy, HOUR_COLOR, cached_points + ((sHandLen + 1) * 2), hHandLen + 1, true, false);
draw_and_erase_cached_line(center, center, nmx, nmy, MINUTE_COLOR, cached_points + ((sHandLen + 1 + hHandLen + 1) * 2), mHandLen + 1, true, true);
gfx->endWrite();
}
int32_t slider_value = lv_slider_get_value(ui_Slider1);
int32_t brightness = map(slider_value, 0, 100, 5, 255);
gfx->Display_Brightness(brightness);

![]() | ![]() |
|---|


This chapter includes the following sections, please read as needed:
The following environment settings are applicable to Windows 10/11 systems. For Mac/Linux users, please refer to the official instructions
Download and install Visual Studio Code.
In VS Code, open the Extensions view by clicking the in the VS Code sidebar or using the shortcut (Ctrl+Shift+X). Then, search for the ESP-IDF extension and install it.

After the extension is installed, the will appear in the activity bar on the left side of VS Code. Clicking this icon will view the basic command list for the ESP-IDF extension. Select Configure ESP-IDF extension under Advanced.

Choose Express to enter quick configuration mode:

Modify the following options as needed:

Click Install to start the installation. You will see a page displaying the installation progress, including the progress status of ESP-IDF download, ESP-IDF tool download and installation, as well as the creation of the Python virtual environment.

If everything is installed correctly, you'll get a prompt confirming all the setup is done, and you're ready to start using the extension.

Note: If ESP-IDF installation fails or needs to be reinstalled, you can try deleting the C:\Users\%Username%\esp and C:\Users\%Username%\.espressif folders and then retry.
The ESP-IDF demos are located in the ESP-IDF directory of the demo package.
| Demo | Basic Description |
|---|---|
| 01_AXP2101 | Drives the AXP2101 PMU using the ported XPowersLib to get power-related data |
| 02_PCF85063 | Drives the PCF85063 RTC for time storage and reading |
| 03_esp_brookesia | Show a complete mobile-style UI system, including components such as the status bar, navigation bar, app launcher, and gesture interactions |
| 04_QMI8658 | Drives the QMI8658 IMU using the ported SensorLib to get gyroscope-related data |
| 05_LVGL_WITH_RAM | Run the LVGL demo by enabling double buffering and DMA acceleration to prevent tearing |


![]() |
|---|

![]() | ![]() |
|---|
Development Board Design File
Official ESP32-C6 Chip Manuals
Onboard Component Datasheets
Monday-Friday (9:30-6:30) Saturday (9:30-5:30)
Email: services01@spotpear.com