Google Chat: zj734465502@gmail.com
+86-0755-88291180
sales01@spotpear.com
dragon_manager@163.com
services01@spotpear.com
manager01@spotpear.com
WhatsApp:13246739196
This is a low-cost, high-performance MCU development board designed by Waveshare. It supports 2.4GHz WiFi and BLE 5, integrates high-capacity Flash and PSRAM, and has a 7inch wide capacitive touch LCD screen on board to smoothly run GUI interface programs such as LVGL. It combines a variety of peripheral interfaces (e.g., CAN, I2C, RS485, etc.) to quickly develop applications such as HMIs for ESP32-S3. With a wide range of functions and interfaces, it can meet power consumption requirements in Internet of Things (IoT), mobile devices, smart home and other applications.
1. ESP32-S3-WROOM-1-N16R8 module 2. Display terminal 3. Touchscreen terminal 4. TF card slot 5. USB Type-C port 6. USB TO UART Type-C port 7. UART terminal 8. I2C terminal 9. Sensor terminal 10. CAN terminal 12. 5V output | 13. 3.7V single lithium battery PH2.0 socket 14. CAN termination resistor selection 15. RS485 termination resistor selection 16. UART selection 17. BOOT button 18. RESET button 19. DONE 20. CHARGE 21. POWER |
ESP32-S3 | LCD | Description |
GPIO0 | G3 | Green data 3rd place |
GPIO1 | R3 | Red data 3rd place |
GPIO2 | R4 | Red data 4th place |
GPIO3 | VSYNC | Vertical synchronization signal |
GPIO5 | DE | Data enable signal |
GPIO7 | PCLK | Clock signal |
GPIO10 | B7 | Blue 7th place |
GPIO14 | B3 | Blue 3rd place |
GPIO17 | B6 | Blue 6th place |
GPIO18 | B5 | Blue 5th place |
GPIO21 | G7 | Green 7th place |
GPIO38 | B4 | Blue 4th place |
GPIO39 | G2 | Green 2nd place |
GPIO40 | R7 | Red 7th place |
GPIO41 | R6 | Red 6th place |
GPIO42 | R5 | Red 5th place |
GPIO45 | G4 | Green 4th place |
GPIO46 | HSYNC | Horizontal synchronization signal |
GPIO47 | G6 | Green 6th place |
GPIO48 | G5 | Green 5th place |
IO EXTENSION | LCD | - |
EXIO2 | DISP | Backlight enable pin |
EXIO6 | LCD_VDD_EN | VCOM voltage enable pin |
ESP32-S3 | Touch | Description |
GPIO4 | TP_IRQ | Touch interrupt pin |
GPIO8 | TP_SDA | Touch data pin |
GPIO9 | TP_SCL | Touch clock pin |
IO EXTENSION | Touch | - |
EXIO1 | TP_RST | Touch reset pin |
ESP32-S3 | USB | Description |
GPIO19 | USB_DN | Data cable D- |
GPIO20 | USB_DP | Data cable D+ |
IO EXTENSION | USB | - |
EXIO5 | USB_SEL | Pull down to USB mode, otherwise CAN mode |
ESP32-S3 | TF | Description |
GPIO11 | MOSI | TF card input pin |
GPIO12 | SCK | TF card clock pin |
GPIO13 | MISO | TF card output pin |
IO EXTENSION | TF | - |
EXIO4 | SD_CS | TF card enable pin, active low |
ESP32-S3 | RS485 | Description |
GPIO16 | RS485_RXD | Data input |
GPIO15 | RS485_TXD | Data output |
ESP32-S3 | CAN | Description |
GPIO20 | CANTX | Data output |
GPIO19 | CANRX | Data input |
IO EXTENSION | CAN | - |
EXIO5 | CAN_SEL | Pull up to CAN mode, otherwise USB mode |
ESP32-S3 | I2C | Description |
GPIO8 | SDA | I2C data pin |
GPIO9 | SCL | I2C clock pin |
Basic parameters | |
---|---|
Processor | High-performance 32-bit Xtensa LX7 dual-core processor with a frequency up to 240MHz |
Wifi/Bluetooth | Supports 2.4 GHz Wi-Fi (802.11 b/g/n) and Bluetooth 5 (LE) with onboard antennas |
Flash | 16MB Flash |
PSRAM | 8MB PSRAM |
Power supply range | TypeC 5V |
Screen parameters | |
Resolution | 1024 x 600 |
Display interface | RGB |
Display panel | IPS |
Viewing angle | 170° |
Screen brightness | 235 cd/m² |
Touch type | Capacitive |
Touch panel | toughened glass |
Peripheral interface | |
Communication interface | CAN, RS485, I2C, USB |
Other | |
Power consumption | 5V 350mA |
Operating temperature | 0℃ ~ 65℃ |
Product size (L×W) | Non-touch version: 164×97mm Touch version: 192.96×110.76mm |
Currently there are three development tools and frameworks, Arduino IDE, ESP-IDF and PlatformIO, providing flexible development options, you can choose the right development tool according to your project needs and personal habits.
Arduino IDEArduino IDE is an open source electronic prototyping platform, convenient and flexible, easy to get started. After a simple learning, you can start to develop quickly. At the same time, Arduino has a large global user community, providing an abundance of open source code, project examples and tutorials, as well as rich library resources, encapsulating complex functions, allowing developers to quickly implement various functions. | |
ESP-IDFESP-IDF, or full name Espressif IDE, is a professional development framework introduced by Espressif Technology for the ESP series chips. It is developed using the C language, including a compiler, debugger, and flashing tool, etc., and can be developed via the command lines or through an integrated development environment (such as Visual Studio Code with the Espressif IDF plugin). The plugin offers features such as code navigation, project management, and debugging, etc. | |
PlatformIOPlatformIO is a cross-platform, cross-architecture, multi-framework professional tool for embedded system engineers and software developers who write applications for embedded products. |
Each of these three development approaches has its own advantages, and developers can choose according to their needs and skill levels. Arduino and PlatformIO (faster compilation speed) are suitable for beginners and non-professionals because they are easy to learn and quick to get started. ESP-IDF is a better choice for developers with a professional background or high performance requirements, as it provides more advanced development tools and greater control capabilities for the development of complex projects.
CONFIG_FREERTOS_HZ=1000 CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y CONFIG_ESPTOOLPY_FLASHMODE_QIO=y CONFIG_ESPTOOLPY_FLASHFREQ_120M=y [Need to be consistent with PSRAM] CONFIG_SPIRAM_MODE_OCT=y CONFIG_IDF_EXPERIMENTAL_FEATURES=y and CONFIG_SPIRAM_SPEED_120M=y [Need to be consistent with FLASH] CONFIG_SPIRAM_FETCH_INSTRUCTIONS=y CONFIG_SPIRAM_RODATA=y CONFIG_ESP32S3_DATA_CACHE_LINE_64B=y CONFIG_COMPILER_OPTIMIZATION_PERF=y #The following LVGL configuration items are helpful for frame rate improvement (LVGL v8.3): #define LV_MEM_CUSTOM 1 or CONFIG_LV_MEM_CUSTOM=y #define LV_MEMCPY_MEMSET_STD 1 or CONFIG_LV_MEMCPY_MEMSET_STD=y #define LV_ATTRIBUTE_FAST_MEM IRAM_ATTR or CONFIG_LV_ATTRIBUTE_FAST_MEM=y
0 1 2 3 4 5 6 7 8 9 a b c d e f 00: - - - - - - - - - - - - - - - - 10: - - - - - - - - - - - - - - - - 20: - - - - 24 - - - - - - - - - - - 30: - - - - - - - - - - - - - - - - 40: - - - - - - - - - - - - - - - - 50: - - - - - - - - - - - - - - 5d - 60: - - - - - - - - - - - - - - - - 70: - - - - - - - - - - - - - - - -
This chapter introduces setting up the Arduino environment, including the Arduino IDE, management of ESP32 boards, installation of related libraries, program compilation and downloading, as well as testing demos. It aims to help users master the development board and facilitate secondary development.
Board name | Board installation requirement | Instruction |
---|---|---|
esp32-XIP-3.1.1 | "Install Offline" | The "esp32-XIP-3.1.1" board must be installed according to the installation tutorial |
Library Name | Description | Version | Library Installation Requirement |
---|---|---|---|
lvgl | LVGL graphical library | v8.4.0 | "Install Offline" |
lv_conf.h | LVGL configuration file | —— | "Install Offline" |
File
-> New Sketch
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
}
void loop() {
// put your main code here, to run repeatedly:
Serial.println("Hello, World!");
delay(2000);
}
File
-> Save As...
. In the pop-up menu, select the path to save the project, and enter a project name, such as Hello_World, click Save
①. Click to select the dropdown menu option Select Other Board and Port;
②. Search for the required development board model esp32s3 dev module and select;
③. Select COM Port;
④. Save the selection.
①. Compile the program; ②. Compile and download the program; ③. Download successful.
Demo | Basic Description | Dependency Library |
---|---|---|
01_GPIO | Test GPIO | - |
02_UART | Test UART | - |
03_I2C | Test I2C | - |
04_CAN | Test CAN | - |
05_RS485 | Test I2C | - |
06_LCD | Test display | - |
07_SD | Test TF card | - |
08_TOUCH | Test touchscreen | - |
09_DISPLAY_BMP | Display BMP images from the TF card on the screen | - |
11_WIFI_STA | Connect to the AP and display the IP | - |
12_WIFI_AP | Start AP and display the MAC address of connected devices | - |
13_LVGL_TRANSPLANT | Transplant LVGL | LVGL |
14_LVGL_BTN | Draw a button to control GPIO operation | LVGL |
15_LVGL_SLIDER | Draw a slider to control backlight and GPIO output, and simultaneously display battery voltage | LVGL |
Hardware connection
Code analysis
setup()
:setup()
function initializes GPIO 6 and sets it to output mode.
loop()
:loop()
function is the main loop of the program, with the core functionality of repeatedly pulling the GPIO pin high or low to control the LED's on and off.
Demo flashing
Result demonstration
Hardware connection
Code analysis
setup()
:setup
function is primarily used for initializing serial communication
Use the UART.begin
function to initialize serial port Serial
, set the baud rate, data format, and specify the receive and transmit pins. Then, through a loop, ensure the serial port initialization is successful.
loop()
:loop
function is the main loop part of the program, and its main function is to implement simple UART communication data return
By checking whether there is data available at the serial port, if there is data, it reads a byte and sends it back immediately, so that the received UART data can be sent back intact
Demo flashing
Result demonstration
Hardware connection
Code analysis
setup()
:setup()
function initializes I2C and IO expansion.
DEV_I2C_Init()
:DEV_I2C_Init()
function initializes the I2C device
IO_EXTENSION_Init()
:IO_EXTENSION_Init()
function initializes IO extension.
loop()
:loop()
function is the main loop of the program, with the core functionality of controlling the IO expansion chip to repeatedly pull the DISP pin high or low, thereby controlling the screen backlight on and off.
IO_EXTENSION_Output(uint8_t pin, uint8_t value)
:IO_EXTENSION_Output(uint8_t pin, uint8_t value)
function controls the IO expansion chip to output a specified level.
Demo flashing
Result demonstration
Hardware connection
Code analysis
setup()
:setup()
function initializes I2C, IO expansion, and CAN interface. Before initializing the CAN interface, it needs to control IO_EXTENSION_IO_5 to a high level; otherwise, the CAN interface will not work.
can_init(twai_timing_config_t t_config, twai_filter_config_t f_config, twai_general_config_t g_config)
:can_init
function is mainly responsible for handling the initialization of TWAI (an interface similar to the CAN bus)loop()
:loop()
function checks if any alarms occur. Read the triggered alerts by calling can_read_alerts
and obtain the TWAI status information into alerts_triggered
. Then, according to the different alarms triggered, perform corresponding processing. For example, if an error passive alarm, a bus error alarm, a transmission failure alarm, or a transmission success alarm is triggered, print the corresponding message and output some status information such as the bus error count, the number of messages to be sent, the transmission error counter, and the transmission failure counter.
Demo flashing
Result demonstration
Hardware connection
Code analysis
setup()
:setup
function is primarily used for initializing serial communication
Use the RS485.begin
function to initialize serial port Serial1
, set the baud rate, data format, and specify the receive and transmit pins. Then, through a loop, ensure the serial port initialization is successful.
loop()
:loop
function is the main loop part of the program, and its main function is to implement simple 485 communication data return
By checking whether there is data available at the serial port, if there is data, it reads a byte and sends it back immediately, so that the received 485 data can be sent back intact
Demo flashing
Result demonstration
Hardware connection
Code analysis
setup()
:setup
function mainly performs a series of initialization operations and tests on the displaywaveshare_esp32_s3_rgb_lcd_init()
:waveshare_esp32_s3_rgb_lcd_init
function mainly initializes the RGB LCD.wavesahre_rgb_lcd_bl_on()
:wavesahre_rgb_lcd_bl_on
function mainly turns on the LCD backlight.Demo flashing
Result demonstration
Hardware connection
Code analysis
setup()
:setup
function mainly performs a series of initialization operations and tests on the TF card, and displays relevant information on the screen.
sd_mmc_init()
:sd_mmc_init
function mainly initializes and mounts the TF card.
read_sd_capacity(uint64_t *total_capacity, uint64_t *available_capacity)
:read_sd_capacity
function primarily reads the memory information of the TF card.
Demo flashing
Result demonstration
Hardware connection
Code analysis
setup()
:setup
function mainly performs a series of initialization operations and tests on the touch screen, and displays it on the screen.
touch_gt911_init()
:touch_gt911_init
function mainly initializes the touchscreen.
touch_gt911_read_point(uint8_t max_touch_cnt)
:
touch_gt911_read_point
function mainly reads the current coordinate point and can recognize up to 5 touch points.
Demo flashing
Result demonstration
Hardware connection
Code analysis
setup()
:setup
function mainly performs a series of initialization operations and reads image files, and switches display by clicking the arrow on the screen.
list_files(const char *base_path)
:list_files
function mainly reads BMP image file names and saves the names to BmpPath.
GUI_ReadBmp(UWORD Xstart, UWORD Ystart, const char *path)
:GUI_ReadBmp
function primarily reads BMP image data from the TF card and writes the data into the buffer, with the position determined by Xstart and Ystart.
Demo flashing
Result demonstration
Hardware connection
Code analysis
setup()
:setup
function mainly performs a series of initialization operations and scans nearby Wi-Fi, and displays the names of the scanned Wi-Fi networks on the screen (currently, it cannot display Chinese characters because the font library is not comprehensive enough).
wifi_scan()
:wifi_scan
function primarily scans for nearby Wi-Fi and writes the data to a cache buffer.
Demo flashing
Result demonstration
Hardware connection
Code analysis
setup()
:setup
function mainly performs a series of initialization operations and connects to the specified WIFI (2.4GHz), and displays the IP address of the WIFI on the screen.
Demo flashing
Result demonstration
Hardware connection
Code analysis
setup()
:setup
function mainly performs a series of initialization operations and creates a hotspot named ESP32-S3-Touch-LCD-7B, and displays the MAC address of the currently connected device on the screen.
Demo flashing
Result demonstration
Hardware connection
Code analysis
setup()
:code> setup function mainly performs a series of initialization operations and runs the LVGL Demo.
Demo flashing
Result demonstration
Other instructions
Hardware connection
Code analysis
setup()
:setup
function mainly performs a series of initialization operations and creates a button. Clicking the button can control the LED to turn on or off.
Demo flashing
Result demonstration
Hardware connection
Code analysis
setup()
:setup
function mainly performs a series of initialization operations and creates a slider and text (displaying battery voltage).
Demo flashing
Result demonstration
This chapter introduces setting up the ESP-IDF environment setup, including the installation of Visual Studio and the Espressif IDF plugin, program compilation, downloading, and testing of demos, to assist users in mastering the development board and facilitating secondary development.
①Select the corresponding demo
②Its readme will state what chip the demo applies to (how to use the demo and the file structure are described below, omitted here)
③Click to create the demo
①.ESP-IDF Development Environment Version Manager, when our project requires differentiation of development environment versions, it can be managed by installing different versions of ESP-IDF. When the project uses a specific version, it can be switched to by utilizing it
②.Device flashing COM port, select to flash the compiled program into the chip
③.Select set-target chip model, select the corresponding chip model, for example, ESP32-P4-NANO needs to choose esp32p4 as the target chip
④.menuconfig, click it to Modify sdkconfig configuration file Project configuration details
⑤.fullclean button, when the project compilation error or other operations pollute the compiled content, you can clean up all the compiled content by clicking it
⑥.Build project, when a project satisfies the build, click this button to compile
⑦.Current download mode, the default is UART
⑧.flash button, when a project build is completed, select the COM port of the corresponding development board, and click this button to flash the compiled firmware to the chip
⑨.monitor enable flashing port monitoring, when a project passes through Build --> Flash, click this button to view the log of output from flashing port and debugging port, so as to observe whether the application works normally
⑩.Debug
⑪.Build Flash Monitor one-click button, which is used to continuously execute Build --> Flash --> Monitor, often referred to as "little flame"
CMakeLists.txt
.CMake
first reads the content of the top-level CMakeLists.txt
in the project directory to read the build rules and identify the content to be compiled. When the required components and demos are imported into the CMakeLists.txt
, the compilation tool CMake
will import each content that needs to be compiled according to the index. The compilation process is as follows:Demo | Basic Description |
---|---|
01_GPIO | Test GPIO |
02_UART | Test UART |
03_I2C | Test I2C |
04_CAN | Test CAN |
05_RS485 | Test I2C |
06_LCD | Test display |
07_SD | Test TF card |
08_TOUCH | Test touchscreen |
09_DISPLAY_BMP | Display BMP images from the TF card on the screen |
11_WIFI_STA | Connect to the AP and display the IP |
12_WIFI_AP | Start AP and display the MAC address of connected devices |
13_LVGL_TRANSPLANT | Transplant LVGL |
14_LVGL_BTN | Draw a button to control GPIO operation |
15_LVGL_SLIDER | Draw a slider to control backlight and GPIO output, and simultaneously display battery voltage |
16_LVGL_UI | Comprehensive demo |
Hardware connection
Code analysis
app_main()
:Result demonstration
Hardware connection
Code analysis
app_main()
:By checking whether there is data available on the serial port, if there is data, it is read and immediately sent back, achieving the function of returning the received UART data intact.
Result demonstration
Hardware connection
Code analysis
app_main()
:DEV_I2C_Init()
:DEV_I2C_Init()
function initializes the I2C device
IO_EXTENSION_Init()
:IO_EXTENSION_Init()
function initializes IO extension.
IO_EXTENSION_Output(uint8_t pin, uint8_t value)
:IO_EXTENSION_Output(uint8_t pin, uint8_t value)
function controls the IO expansion chip to output a specified level.
Result demonstration
Hardware connection
Code analysis
app_main()
:can_init(twai_timing_config_t t_config, twai_filter_config_t f_config, twai_general_config_t g_config)
:can_init
function is mainly responsible for handling the initialization of TWAI (an interface similar to the CAN bus) can_read_alerts
and obtain the TWAI status information into alerts_triggered
. Then, according to the different alarms triggered, perform corresponding processing. For example, if an error passive alarm, a bus error alarm, a transmission failure alarm, or a transmission success alarm is triggered, print the corresponding message and output some status information such as the bus error count, the number of messages to be sent, the transmission error counter, and the transmission failure counter.Result demonstration
Hardware connection
Code analysis
app_main()
:Initialize the serial port using the DEV_UART_Init
function, set the baud rate, configure the receive and transmit pins, and allocate a temporary buffer for receiving data.
By checking whether there is data available on the serial port, if there is data, it is read and immediately sent back, achieving the function of returning the received RS485 data intact.
Result demonstration
Hardware connection
Code analysis
app_main()
:waveshare_esp32_s3_rgb_lcd_init()
:waveshare_esp32_s3_rgb_lcd_init
function mainly initializes the RGB LCD.wavesahre_rgb_lcd_bl_on()
:wavesahre_rgb_lcd_bl_on
function mainly turns on the LCD backlight.Result demonstration
Hardware connection
Code analysis
app_main()
:sd_mmc_init()
:sd_mmc_init
function mainly initializes and mounts the TF card.
read_sd_capacity(uint64_t *total_capacity, uint64_t *available_capacity)
:read_sd_capacity
function primarily reads the memory information of the TF card.
Result demonstration
Hardware connection
Code analysis
app_main()
:touch_gt911_init()
:touch_gt911_init
function mainly initializes the touchscreen.
touch_gt911_read_point(uint8_t max_touch_cnt)
: touch_gt911_read_point
function mainly reads the current coordinate point and can recognize up to 5 touch points.
Result demonstration
Hardware connection
Code analysis
app_main()
:list_files(const char *base_path)
:list_files
function mainly reads BMP image file names and saves the names to BmpPath.
GUI_ReadBmp(UWORD Xstart, UWORD Ystart, const char *path)
:GUI_ReadBmp
function primarily reads BMP image data from the TF card and writes the data into the buffer, with the position determined by Xstart and Ystart.
Result demonstration
Hardware connection
Code analysis
app_main()
:wifi_scan()
:wifi_scan
function primarily scans for nearby Wi-Fi and writes the data to a cache buffer.
Result demonstration
Hardware connection
Code analysis
app_main()
:Result demonstration
Hardware connection
Code analysis
app_main()
:Result demonstration
Hardware connection
Code analysis
app_main()
:Result demonstration
Other instructions
Hardware connection
Code analysis
app_main()
:Result demonstration
Hardware connection
Code analysis
app_main()
:Result demonstration
Hardware connection
Code analysis
app_main()
:Result demonstration
WIFI
: It can test Scan, STA, and AP, and display related WiFi informationRS485
: It can test the RS485 function, set the baud rate, send and receive dataCAN
: It can test CAN functions, set the rate, and send and receive dataPWM
: It can test backlight, battery voltage reading, and TF cardThis chapter introduces setting up the platformio environment, including the program compilation and downloading, as well as testing demos. It aims to help users master the development board and facilitate secondary development
Create New Project
-> New Projject
-> Set the project name and board model, such as Hello_Worldvoid setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
Serial.println("Hello, World!");
delay(2000);
}
Port
-> Compile and Flash
; When the fifth item is displayed, it indicates that the flashing is successful. Then click on the sixth item to observe the operation of the demo①. Click to open main.cpp file;
②. Enter the code given above and save it;
③. Select COM Port;
④. Compile and flash the demo.
⑤. If SUCCESS appears, it indicates successful flashing.
⑥. Click on serial port assistant, and repeatedly output Hello, World!, then it is successful.
Demo | Basic Description | Dependency Library |
---|---|---|
01_GPIO | Test GPIO | - |
02_UART | Test UART | - |
03_I2C | Test I2C | - |
04_CAN | Test CAN | - |
05_RS485 | Test I2C | - |
06_LCD | Test display | - |
07_SD | Test TF card | - |
08_TOUCH | Test touchscreen | - |
09_DISPLAY_BMP | Display BMP images from the TF card on the screen | - |
11_WIFI_STA | Connect to the AP and display the IP | - |
12_WIFI_AP | Start AP and display the MAC address of connected devices | - |
13_LVGL_TRANSPLANT | Transplant LVGL | LVGL |
14_LVGL_BTN | Draw a button to control GPIO operation | LVGL |
15_LVGL_SLIDER | Draw a slider to control backlight and GPIO output, and simultaneously display battery voltage | LVGL |
Hardware connection
Code analysis
setup()
:setup()
function initializes GPIO 6 and sets it to output mode.
loop()
:loop()
function is the main loop of the program, with the core functionality of repeatedly pulling the GPIO pin high or low to control the LED's on and off.
Result demonstration
Hardware connection
Code analysis
setup()
:setup
function is primarily used for initializing serial communication
Use the UART.begin
function to initialize serial port Serial
, set the baud rate, data format, and specify the receive and transmit pins. Then, through a loop, ensure the serial port initialization is successful.
loop()
:loop
function is the main loop part of the program, and its main function is to implement simple UART communication data return
By checking whether there is data available at the serial port, if there is data, it reads a byte and sends it back immediately, so that the received UART data can be sent back intact
Result demonstration
Hardware connection
Code analysis
setup()
:setup()
function initializes I2C and IO expansion.
DEV_I2C_Init()
:DEV_I2C_Init()
function initializes the I2C device
IO_EXTENSION_Init()
:IO_EXTENSION_Init()
function initializes IO extension.
loop()
:loop()
function is the main loop of the program, with the core functionality of controlling the IO expansion chip to repeatedly pull the DISP pin high or low, thereby controlling the screen backlight on and off.
IO_EXTENSION_Output(uint8_t pin, uint8_t value)
:IO_EXTENSION_Output(uint8_t pin, uint8_t value)
function controls the IO expansion chip to output a specified level.
Result demonstration
Hardware connection
Code analysis
setup()
:setup()
function initializes I2C, IO expansion, and CAN interface. Before initializing the CAN interface, it needs to control IO_EXTENSION_IO_5 to a high level; otherwise, the CAN interface will not work.
can_init(twai_timing_config_t t_config, twai_filter_config_t f_config, twai_general_config_t g_config)
:can_init
function is mainly responsible for handling the initialization of TWAI (an interface similar to the CAN bus)loop()
:loop()
function checks if any alarms occur. Read the triggered alerts by calling can_read_alerts
and obtain the TWAI status information into alerts_triggered
. Then, according to the different alarms triggered, perform corresponding processing. For example, if an error passive alarm, a bus error alarm, a transmission failure alarm, or a transmission success alarm is triggered, print the corresponding message and output some status information such as the bus error count, the number of messages to be sent, the transmission error counter, and the transmission failure counter.
Result demonstration
Hardware connection
Code analysis
setup()
:setup
function is primarily used for initializing serial communication
Use the RS485.begin
function to initialize serial port Serial1
, set the baud rate, data format, and specify the receive and transmit pins. Then, through a loop, ensure the serial port initialization is successful.
loop()
:loop
function is the main loop part of the program, and its main function is to implement simple 485 communication data return
By checking whether there is data available at the serial port, if there is data, it reads a byte and sends it back immediately, so that the received 485 data can be sent back intact
Result demonstration
Hardware connection
Code analysis
setup()
:setup
function mainly performs a series of initialization operations and tests on the displaywaveshare_esp32_s3_rgb_lcd_init()
:waveshare_esp32_s3_rgb_lcd_init
function mainly initializes the RGB LCD.wavesahre_rgb_lcd_bl_on()
:wavesahre_rgb_lcd_bl_on
function mainly turns on the LCD backlight.Result demonstration
Hardware connection
Code analysis
setup()
:setup
function mainly performs a series of initialization operations and tests on the TF card, and displays relevant information on the screen.
sd_mmc_init()
:sd_mmc_init
function mainly initializes and mounts the TF card.
read_sd_capacity(uint64_t *total_capacity, uint64_t *available_capacity)
:read_sd_capacity
function primarily reads the memory information of the TF card.
Result demonstration
Hardware connection
Code analysis
setup()
:setup
function mainly performs a series of initialization operations and tests on the touch screen, and displays it on the screen.
touch_gt911_init()
:touch_gt911_init
function mainly initializes the touchscreen.
touch_gt911_read_point(uint8_t max_touch_cnt)
: touch_gt911_read_point
function mainly reads the current coordinate point and can recognize up to 5 touch points.
Result demonstration
Hardware connection
Code analysis
setup()
:setup
function mainly performs a series of initialization operations and reads image files, and switches display by clicking the arrow on the screen.
list_files(const char *base_path)
:list_files
function mainly reads BMP image file names and saves the names to BmpPath.
GUI_ReadBmp(UWORD Xstart, UWORD Ystart, const char *path)
:GUI_ReadBmp
function primarily reads BMP image data from the TF card and writes the data into the buffer, with the position determined by Xstart and Ystart.
Result demonstration
Hardware connection
Code analysis
setup()
:setup
function mainly performs a series of initialization operations and scans nearby Wi-Fi, and displays the names of the scanned Wi-Fi networks on the screen (currently, it cannot display Chinese characters because the font library is not comprehensive enough).
wifi_scan()
:wifi_scan
function primarily scans for nearby Wi-Fi and writes the data to a cache buffer.
Result demonstration
Hardware connection
Code analysis
setup()
:setup
function mainly performs a series of initialization operations and connects to the specified WIFI (2.4GHz), and displays the IP address of the WIFI on the screen.
Result demonstration
Hardware connection
Code analysis
setup()
:setup
function mainly performs a series of initialization operations and creates a hotspot named ESP32-S3-Touch-LCD-7B, and displays the MAC address of the currently connected device on the screen.
Result demonstration
Hardware connection
Code analysis
setup()
:code> setup function mainly performs a series of initialization operations and runs the LVGL Demo.
Result demonstration
Other instructions
Hardware connection
Code analysis
setup()
:setup
function mainly performs a series of initialization operations and creates a button. Clicking the button can control the LED to turn on or off.
Result demonstration
Hardware connection
Code analysis
setup()
:setup
function mainly performs a series of initialization operations and creates a slider and text (displaying battery voltage).
Result demonstration
If there's no screen response after programming the code, check whether the correct configurations are set in Arduino IDE -> Tools, select the corresponding Flash (16MB) and enable PSRAM (8MB OPI))
The path to install the library contains Chinese characters, resulting in the inability to find the library file
Please install the Arduino ESP32 that we provided to solve this issue
Yes, you can also customize the frequency of consecutive frames. When the frequency is too high and the computer freezes, it may cause bus errors
Some AppData folders are hidden by default and can be set to show
Press the Windows + R keys to open the "Run" dialog box, input devmgmt.msc and press Enter to open the Device Manager; Expand the "Port (COM and LPT)" section, here it will list all the COM ports and their current status.
It's normal for the first compilation to be slow, just be patient
If there is a reset button on the development board, press the reset button; if there is no reset button, please power it on again
Install MAC Driver and flash again.
The LCD screen display chip used in this product is ST7701, and the touch chip is GT911, we recommend that you directly refer to the demos of Arduino or ESP-IDF
Click this link to view the solution: LCD FAQ
In the main function, comment out the code shown in the red box.
Monday-Friday (9:30-6:30) Saturday (9:30-5:30)
Email: services01@spotpear.com