CrowPanel 1.46 inch HMI ESP32 Rotary Display — Course Index¶
Version: 1.46 | Board: ESP32-S3 | Development environment: Arduino IDE
This course is built around the CrowPanel 1.46-inch HMI ESP32 Rotary Display, a 360×360 round touchscreen development board based on the ESP32-S3. Starting from a first serial "Hello World", the lessons move step by step through the onboard hardware — the ST77961 LCD, the CST816T capacitive touch panel, the A/B two-phase rotary encoder with push button, the LCD backlight PWM, the onboard GPIO4 LED, the exposed I2C and UART interfaces, and the ESP32-S3 native USB HID capability.
Each lesson follows the same structure: course introduction, learning objectives, preparation, software steps, hardware steps, key code explanation, experimental results, and code download. After finishing the whole series you will be able to drive the display and touch layer with LVGL, read sensors over I2C, talk to a Wi-Fi module over UART using AT commands, and turn the touchscreen into a USB HID mouse for a host computer.
Course List¶
| # | Lesson | Topic | Link |
|---|---|---|---|
| 00 | Lesson01_RotaryScreen_LVGL | LVGL basics on the rotary screen — getting the display and touch layer running with LVGL widgets on the 360×360 round LCD | https://www.elecrow.com/wiki/Lesson01_RotaryScreen_LVGL.html |
| 01 | Lesson01_Print_Hello_World | Serial "Hello World" — setup() / loop(), 115200 baud, Serial Monitor verification | https://www.elecrow.com/wiki/1.46_Lesson01_Print_Hello_World.html |
| 02 | Lesson02-Turn_on_the_LED | Touch button controls the LED — LCD + CST816T touch + LVGL event callback + GPIO4 | https://www.elecrow.com/wiki/1.46_Lesson02-Turn_on_the_LED.html |
| 03 | Lesson03_Encoder_Brightness | Encoder adjusts brightness — A/B quadrature decoding, PWM backlight, encoder push button | https://www.elecrow.com/wiki/1.46_Lesson03_Encoder_Brightness.html |
| 04 | Lesson04_DHT20_Temperature_Humidity | DHT20 temperature & humidity over I2C (Wire1, GPIO38/39, address 0x38) | https://www.elecrow.com/wiki/1.46_Lesson04_DHT20_Temperature_Humidity.html |
| 05 | Lesson05_UART_WiFi | UART1 AT commands to join a Wi-Fi network and query the IP address | https://www.elecrow.com/wiki/1.46_Lesson05_UART_WiFi.html |
| 06 | Lesson06_USB_HID_Mouse | Touchscreen as a USB HID mouse — relative movement, left-button press/release via TinyUSB | https://www.elecrow.com/wiki/1.46_Lesson06_USB_HID_Mouse.html |
Lesson Details¶
00. Lesson01_RotaryScreen_LVGL — LVGL on the Rotary Screen¶
Link: https://www.elecrow.com/wiki/Lesson01_RotaryScreen_LVGL.html
An introductory walkthrough of running LVGL on the 1.46-inch rotary display: bringing up the display and touch drivers, creating the first widgets, and confirming that drawing and touch input both work on the round 360×360 panel. Read this before the numbered lessons if you are new to LVGL, because Lessons 02–06 all build their on-screen interfaces on top of it.
You will learn: the basic LVGL object/event model, how the display flush and the touch read callback are registered, and how to verify rendering and input on a round screen.
01. Lesson01_Print_Hello_World — Serial "Hello World"¶
Link: https://www.elecrow.com/wiki/1.46_Lesson01_Print_Hello_World.html
The entry-level lesson for the whole series, and the one that establishes the basic workflow of compile → upload → open the Serial Monitor → verify from the logs. Using the ESP32-S3 Arduino serial functions, the board outputs Hello World once about 300 ms after reset and then repeats it roughly every second at 115200 baud.
Along the way it covers the complete first-time environment setup: confirming the Arduino IDE version, adding the ESP32 board package URL and installing the board support package, creating a correctly named sketch folder, connecting the board over USB-C, selecting ESP32S3 Dev Module and the COM port, checking the upload parameters (Flash Size 16MB, elecrow_s3 partition scheme, OPI PSRAM, USB CDC On Boot), and copying the project libraries into the Arduino libraries folder.
You will learn: the relationship between the one-time setup() initialization and the repeating loop(), why Serial.begin(115200) must match the monitor baud rate, and how to diagnose garbled output, missing output, or a stuck Connecting... upload.
02. Lesson02-Turn_on_the_LED — Touch Button Controls the LED¶
Link: https://www.elecrow.com/wiki/1.46_Lesson02-Turn_on_the_LED.html
Creates an LVGL button on the 360×360 ST77961 LCD and uses the CST816T capacitive touch input to control the onboard GPIO4 LED. At startup the screen shows LED OFF; tapping the button toggles both the LED level and the label text.
This lesson validates the full chain of LCD + touch + LVGL events + digital output. The key code section explains how readTouch() converts CST816T coordinates into an LVGL input state (including the mandatory released state when there is no touch), how the click callback updates the GPIO and the label from the same state variable, and why examplePower(), touch.begin(), exampleDisplay(), and lv_indev_create() must all run in order.
You will learn: wiring and programming the LCD, touch panel and LED together, and troubleshooting a screen that changes while the LED does not, or a touchscreen that does not respond at all.
03. Lesson03_Encoder_Brightness — Adjusting Brightness with the Rotary Encoder¶
Link: https://www.elecrow.com/wiki/1.46_Lesson03_Encoder_Brightness.html
Reads the A/B two-phase rotary encoder on GPIO45/42, determines the rotation direction with a quadrature state lookup table, and adjusts the LCD backlight via PWM. Pressing the encoder button on GPIO41 toggles the GPIO4 LED. The screen displays the brightness percentage and the LED status, making this a complete "input → state calculation → display → output" example.
The key code section covers the 16-entry state table, the accumulator that must reach ±4 before the brightness steps by 5% (which filters contact bounce and encoder noise), the mapping of 0–100% duty to the 0–255 PWM range, and the pull-up high-to-low edge detection that stops the button from retriggering while held.
You will learn: how A/B phase signals encode direction, why the accumulator threshold matters, and how to check A/B wiring if the rotation direction comes out reversed. Do not plug or unplug exposed wires while the board is powered.
04. Lesson04_DHT20_Temperature_Humidity — Reading and Displaying Temperature and Humidity¶
Link: https://www.elecrow.com/wiki/1.46_Lesson04_DHT20_Temperature_Humidity.html
Uses Wire1 on GPIO38/39 to read a DHT20 sensor over I2C at address 0x38. Roughly every two seconds the temperature and humidity are parsed and shown on the LCD, with the same content mirrored to the serial port. The focus is on I2C command sequences, 6-byte data parsing, and clear read-failure reporting.
The key code section shows the 0xAC 0x33 0x00 measurement command, the 80 ms wait, the 6-byte read, and the conversion of the packed 20-bit raw humidity and temperature values into % and °C. It also explains the status bits in d[0] and the resulting DHT20 read error message. Note that this board exposes extra I2C pins, so the sensor can be wired directly without the FPC cable.
You will learn: correct SDA/SCL wiring and initialization, the raw-to-engineering-unit conversion, and how to troubleshoot an incorrect address, wire order, or wait time from the on-screen and serial messages.
05. Lesson05_UART_WiFi — Connecting to a Wireless Network with UART AT Commands¶
Link: https://www.elecrow.com/wiki/1.46_Lesson05_UART_WiFi.html
Uses UART1 (TX=43, RX=44, 115200 baud, SERIAL_8N1) to talk to a Wi-Fi AT-command module. The program sequentially sends AT, switches to STA mode, joins the configured network, and queries the IP address, showing the current stage on the LCD while printing the module responses to the serial port.
The key code section explains the at() helper that sends a command, collects the response within a timeout, and checks for OK; the 15-second timeout used for AT+CWJAP because joining a network is slow; and the AT+CIFSR IP query. The rotary display exposes extra UART pins, so the module connects directly without an FPC cable. Replace the sample credentials with your own test network before running, and never commit real passwords.
You will learn: UART pin and baud configuration, AT command/response handling, and how to diagnose Module not found versus Connect failed from crossed TX/RX wiring, a bad password, or weak signal.
06. Lesson06_USB_HID_Mouse — Simulating a USB HID Mouse with the Touchscreen¶
Link: https://www.elecrow.com/wiki/1.46_Lesson06_USB_HID_Mouse.html
Reads touch coordinates from the CST816T and converts touch dragging into computer mouse movement through the ESP32-S3's native USB HID Mouse support. The left button stays pressed while the screen is touched and is released when the finger lifts. This lesson needs USB-OTG (TinyUSB) mode rather than "Hardware CDC and JTAG", plus a cable and host that support USB OTG.
The key code section explains that the first touch only records a starting point, that each loop turns the coordinate difference into a HID relative movement clamped to ±127, that the left button is held for the duration of the touch, and that the coordinates must be updated every cycle to avoid runaway accumulation. Releasing the button when the touch disappears is critical, otherwise the host believes the button is still held.
You will learn: touch-coordinate to relative-movement mapping, USB HID initialization, and how to verify press / move / release by dragging on the screen. If the host does not respond, check the OTG connection direction, the USB mode setting, and the serial readiness message.
Shared Code and Libraries¶
All lesson sketches and the shared Common_1_46.h header, plus the dependency libraries, come from the same repository:
Related setup guides on the Elecrow Wiki:
- Arduino IDE installation — https://www.elecrow.com/wiki/Get_Started_with_Arduino_IDE.html
- Importing library files into Arduino — https://www.elecrow.com/wiki/Arduino_IDE_Library_Import_Guide.html
Recommended Learning Path¶
- Lesson01_RotaryScreen_LVGL — get LVGL drawing and touch input working on the round screen.
- Lesson01_Print_Hello_World — set up the toolchain and confirm upload + serial verification.
- Lesson02-Turn_on_the_LED — LCD, touch and LVGL events driving a real output.
- Lesson03_Encoder_Brightness — rotary encoder input, PWM backlight and LED.
- Lesson04_DHT20_Temperature_Humidity — external sensor over the extra I2C pins.
- Lesson05_UART_WiFi — external module over the extra UART pins.
- Lesson06_USB_HID_Mouse — native USB HID, the most advanced topic in the series.