Quick Start for Beginners: Mastering ESP32 with Arduino IDE

Quick Start for Beginners: Mastering ESP32 with Arduino IDE
Hello everyone, I am Machine Panda.
In order to do a good job, one must first sharpen their tools. Therefore, choosing a suitable development environment is crucial. Since this series mainly uses the ESP32 microcontroller, there are generally three mainstream development methods:
Arduino, a convenient and flexible open-source electronic prototyping platform, supports ESP32, ESP8266, etc., and can use Arduino IDE or VSCode/Clion + PlatformIO for project development.
MicroPython, commonly used development software is Thonny, supports Python syntax, and is easy to get started.
ESP-IDF, the official IoT development framework from Espressif, provides a self-sufficient SDK based on C/C++ language, making it easy for users to develop general applications on these platforms.
Arduino is an open-source electronic prototyping platform co-developed by Italian developers Massimo Banzi and David Cuartielles. It consists of two parts: hardware and software. The hardware part includes a controller and some electronic components, while the software part is based on the easy-to-learn C++ programming language, the Arduino IDE.
The biggest advantage of Arduino is its simplicity and ease of learning, making it a popular choice in the fields of electronics and IoT. On the official Arduino website, you can find a variety of project examples, from simple LED blinking to complex robot control. Meanwhile, the Arduino community is very active, with many like-minded developers sharing their works and experiences, helping beginners get started faster.
01.

Installing Arduino IDE

Go to the Arduino official website, directly select “Windows Zip file” to download the portable version. After extracting, you can create a soft link for Arduino IDE.exe on your desktop.
Quick Start for Beginners: Mastering ESP32 with Arduino IDE
After opening Arduino IDE, you will see four icons, which represent “Verify”, “Upload”, “Start Debugging”, and “Select Board”. “Verify” means compiling your program, “Upload” means burning your program into the microcontroller (for specific burning methods, refer to the previous chapter on “Microcontroller Program Burning”), and “Start Debugging” means debugging your program. The following mainly explains the “Select Board” function; other functions can only be used after completing the board selection.
Quick Start for Beginners: Mastering ESP32 with Arduino IDE
Open the Arduino IDE, go to the “File” – “Preferences” menu, and copy the ESP32 series download address to the specified location.
Quick Start for Beginners: Mastering ESP32 with Arduino IDE
Then click “Select Board” and choose “ESP32 Dev Module” and the corresponding COM port number. After completing the above operations, you can burn the code into the microcontroller via the “Upload” button..
Quick Start for Beginners: Mastering ESP32 with Arduino IDE
02.

Code Structure

This article uses C++ as the preferred development language, but its development process is different from ordinary C++ development. When first using Arduino IDE, you will find two functions: setup() and loop(). The setup() function runs only once when the program is powered on for the first time, while the loop() function is the core loop of the main program, which gets repeatedly called whenever the Arduino board runs. The longer the execution time of the code in loop(), the longer the loop cycle will be. For example, the delay() function in the example will block the program’s execution.
03.

Loading Third-Party Libraries

When writing code, we will use many excellent libraries that already exist in the community. In Arduino IDE, developers can find them directly in the community library or introduce them into their projects via .ZIP files.
Quick Start for Beginners: Mastering ESP32 with Arduino IDEQuick Start for Beginners: Mastering ESP32 with Arduino IDE
END
In addition, I will continue to share knowledge about robot applications in the future. If you find it good, don’t forget to like and follow, as there will be more knowledge about robot applications waiting for you!

Leave a Comment

Your email address will not be published. Required fields are marked *