ESP32 Display 3.5-inch HMI MicroPython Tutorial

From Elecrow
Jump to navigation Jump to search

This tutorial will demonstrate how to program the ESP Terminal SPI via MicroPython.

The project of this tutorial is a smart light. When the ambient light intensity is lower than 60%, the LED will light up, otherwise, the LED will go out.

Hardware Preparation

ESP32 Display 3.5-inch Crowtail-Light Sensor Crowtail-LED USB-A(or USB-C) to USB-C cable 2* 4-Pin HY2.0 Cables
35-ecp32dispaly-mainpic.png Crowtail- Digital Light Sensor1.JPG Crowtail-LED1.JPG USB-C-CABLE.jpg CROWTAIL-CABLE.jpg
Get one now Get one now Get one now Get one now Get one now

Software Preparation

Download software

Go to https://thonny.org/ and download the corresponding software version (take the Windows version as an example). Download-thonny.jpg

Double-click the downloaded exe file to install the software. (Go to the next step and install directly)

Download firmware

Open the Thonny software and click Tools→Options
THONNY-OPTIONS.jpg

Click "Interpreter" and select "MicroPython(ESP32)"
Micropython-esp32.jpg

Select the serial port number (you need to press the hardware BOOT key and then connect to the computer, if no com number is displayed, check whether the serial port driver is installed)
Micropython-tutorial-SPI-port.png

Click "Install or update MicroPython(esptool)" to download the firmware
Micropython-tutorial-SPI-firmware.png

Choose to download the firmware from local and click Install (select the firmware corresponding to the screen)
Micropython-tutorial-SPI-esptool.png

Micropython-tutorial-SPI-install.png

Wait for successful installation
Micropython-tutorial-SP-firmware downloadingI.png

Run program

Click the reset button on the screen or reinsert the data cable to open the routine program.
Micropython-tutorial-SP-2I.png

Run the program
Micropython-tutorial-SPI-run.png

When the light intensity exceeds 60%, the light goes out. Light is on when the light intensity is less than 60%
Micropython-tutorial-SPI-result.png Micropython-tutorial-SPI-result1.png

Resources