Home ARDUINO How to Program Esp32 with Arduino IDE with C++

How to Program Esp32 with Arduino IDE with C++

0

The Arduino IDE has an add-on that allows you to program the ESP32 using the Arduino IDE and its programming language. In this tutorial, we will show you how to install an ESP32 board in the Arduino IDE for Windows.

ESP32:

Although ESP8266 is still one of the most commonly used WiFi development boards in hand-crafted IoT projects, the new ESP32 is attracting attention. Although it is not so new, the popularity of ESP32 began to grow last year, mainly because of its Bluetooth capabilities, but not only that. The ESP32 is now equipped with nearly 32 I/O pins and a powerful 32-bit dual-core CPU that can handle more complex jobs.

Getting Started

Collect Requirements

Note

If this is your first time installing ESP32 on the Arduino IDE, just follow the installation steps described below;

If you have installed the ESP32 add-in using the old method, you should first delete the espressif folder. Go to the end of this article to learn how to delete the espressif folder.

  1. Install the ESP32 board

To install the ESP32 board in the Arduino IDE, please follow the instructions below:

1) Open the Preferences window from the Arduino IDE. Go to File > Preferences

2) Enter https://dl.espressif.com/dl/package_esp32_index.json in the “Other Board Manager URL” field as shown below. Then click the “OK” button:

Note: If you already have an ESP8266 board URL, you can separate the URLs with a comma as follows:

https://dl.espressif.com/dl/package_esp32_index.json,

http://arduino.esp8266.com/stable/package_esp8266com_index.json

3) Open board manager. Go to Tools > Board > Board Manager…

4) Search for ESP32 and press the “ESP32 by Espressif Systems” installation button:

5) That’s it. It should be installed in a few seconds.

  1. Delete the espressif folder

If this is the first time you have installed ESP32 on the Arduino IDE, you can ignore this section.

If you have followed the older installation process and have manually installed the ESP32 add-on using the Git GUI, you will need to remove the espressif folder from the Arduino IDE.

To find the espressif folder and the Arduino IDE location (installation path), open the Arduino IDE and go to File > Preferences:

Copy the location from the “Sketchbook location” field:

Go to the Arduino IDE location directory: C:\ Users \ ruisantos \ Documents \ Arduino and open the hardware folder:

 

Then, delete the espressif folder:

Test installation

Insert the ESP32 board into your computer. Then follow these steps:

1) Open the Arduino IDE

2) Select your board in the Tools > Board menu (in my case it is DOIT ESP32 DEVKIT V1)

 

3) Select the port (if you don’t see the COM port in the Arduino IDE, you need to install the ESP32 CP210x USB to the UART bridge VCP driver):

4) Open the following example under File > Example > WiFi (ESP32) > WiFi Scan

 

 5) Open a new sketch:

6) Press the Upload button in the Arduino IDE. Wait a few seconds while the code is compiled and uploaded to your board.

7) If everything goes as expected, you should see the “Complete upload.” message.

Esp32 Arduino

8) Open the Arduino IDE serial monitor at a baud rate of 115200:

9) Press the ESP32 onboard enable button and you should see the network available near ESP32:

This is a very basic tutorial that demonstrates how to prepare an Arduino IDE for ESP32 on a Windows PC.

Related posts

How to Build Multi-Meter with Arduino UNO and B25 Voltage sensor

How to Drive PIR Motion sensor With Arduino UNO and Buzzer

LEAVE A REPLY

Please enter your comment!
Please enter your name here

12 + seven =