There is a new Arduino IDE – Arduino IDE 2.0 (beta). In this tutorial, you will learn how to install an ESP32 board in Arduino IDE 2.0 and upload code to the board. This tutorial is compatible with Windows, Mac OS X, and Linux operating systems.
According to the Arduino website: “Arduino IDE 2.0 is an evolution of the classic IDE with higher performance, an improved user interface, and many new features such as autocomplete, a built-in debugger, and sketch synchronization with the Arduino Cloud”.
Prerequisite: Arduino IDE 2.0 installed
Before proceeding, make sure you have Arduino IDE 2.0 installed on your computer.
Visit the Arduino website and download the appropriate version for your operating system.
- Windows: Run the downloaded file and follow the instructions in the installation guide.
- Mac OS X: Copy the downloaded file to your Applications folder.
- Linux: Unzip the downloaded file, and then open the file where arduinoide will start the IDE.
If in doubt, you can check out the Arduino installation guide.
Install the ESP32 plug-in in Arduino IDE
To install the ESP32 board in the Arduino IDE, follow these instructions:
1.In Arduino IDE 2.0, go to FilePreferences.
2. Copy and paste the following lines into the Other Board Managers URL field.
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
Note: If you already have the ESP8266 development board URL, you can separate the URLs with commas like this:
http://arduino.esp8266.com/stable/package_esp8266com_index.json, https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
3. Open the Board Manager. You can go to Tools > Board > Board Manager… or just click on Board Manager icon.
4. Search forESP32 and press theesp32Install button for Espressif Systems.
That’s it. It should be installed in a few seconds.
Test installation
To test the ESP32 add-on installation, we will upload a simple code that blinks the onboard LED (GPIO 2).
Copy the following code to your Arduino IDE:
/******** Rui Santos Complete project details at https://RandomNerdTutorials.com/vs-code-platformio-ide-esp32-esp8266-arduino/ *********/ #include <Arduino.h> #define LED 2 void setup() { // put your setup code here, to run once: Serial.begin(115200); pinMode(LED, OUTPUT); } void loop() { // put your main code here, to run repeatedly: digitalWrite(LED, HIGH); Serial.println("LED is on"); delay(1000); digitalWrite(LED, LOW); Serial.println("LED is off"); delay(1000); }
Upload sketch
In the top drop-down menu, select the “Unknown” board. A new window will open as shown below.
You should select the ESP32 board model and COM port. In our example we use the DOIT ESP32 DEVKIT V1 board. ClickOK when finished.
Now all you have to do is click the Upload button.
After a few seconds, the upload should complete.
Note: Some ESP32 boards will not automatically enter refresh/upload mode when uploading new code, and you will see many dots on the debug window followed by an error message. If this is the case, you will need to press the ESP32 BOOT button when you start seeing these dots on the debug window.
The ESP32 onboard LED should blink once per second.
Serial Monitor
You can click the Serial Monitor icon to open the Serial Monitor tab.
That’s it! You have successfully installed the ESP32 development board in Arduino IDE 2.0.
The knowledge points of the article match the official knowledge files, and you can further learn relevant knowledge. CS entry skill treeLinux introductionOnline installation software 38082 people are learning the system