In this lesson, you will learn how to set up your Arduino IDE so that you can use it to program your ESP32. This lesson contains instructions for Windows users. If you use a Mac, please look at Lesson 7.
You can watch the video, or if you are the “reading” type, you can read the text below.
One of the really nice things about the ESP32 is that it works with the Arduino IDE.
Not only that, but because of the support that the manufacturer has implemented for the Arduino platform, we can use a lot of the existing Arduino libraries, infrastructure, and hardware.
That means that we can reuse what we already know from our work with the Arduino. We can build on that and make use of all of the additional hardware capabilities that the ESP32 brings along.
To be able to use the Arduino IDE to program the ESP32, you will need to install the ESP32-Arduino Core software. I will show you how to do this now.
I assume that the Arduino IDE is already installed on your PC. If it isn’t, please install it now, and then continue (I’ll wait here, it’s ok 🙂).
Download ESP32-Arduino CoreWith the Arduino IDE installed and operating on your computer, use your browser to download the ESP32 support software from Github.
You can download these files an manually copy them into the hardware folder of your Arduino IDE installation, but there is an easier and safer way. You should use the Arduino IDE Boards Manager. You can find instructions in Github (or just continue reading).
The IDE Boards Manager utility works across platforms. You can use this method on Mac, Windows, or Linux.
Copy this URL:
https://dl.espressif.com/dl/package_esp32_index.json
Open the Preferences window of the Arduino IDE, and paste the URL you just copied in the “Additional Board Manager URLs” field, as you can see in the figure below:
Click Ok to dismiss the Preferences window.
Next, open the Board Manager utility by clicking Tools, Board, Boards Manager in the IDE menu.
Search for “ESP32” in the text box. A single result should appear.
Click on “Install” to do just that. In the Figure below, the ESP32 support is already installed in my Arduino IDE, so the “Install” button is inactive.
There are a few megabytes of file data to download and install, so be patient.
Test the ESP32 supportA while later, when the utility completes the download and installation of the software, confirm that the ESP32 support is there.
In the Arduino IDE menu, click on Tools, Board, and scroll down to see the new ESP32 section. There should be numerous boards there. The one we are interested mostly about, is the generic ESP32 Dev Module, like in the figure below. Click on “ESP32 Dev Module” to select it, and make it the active target in the IDE.
Now that you have selected the ESP32 Dev Module, confirm the selection in the IDE window. The status line should contain the text “EXP32 Dev Module, ” as well as its various parameters, like its frequency and flash memory size.
Let’s do one last test: Load one of the example ESP32 sketches. In the IDE menu, select File, Examples, ESP32, AnalogOut, ledcWrite_RGB. This is actually one of the sketches we discuss in the video lecture.
This sketch demonstrates how to create PWM output, and uses functions that come with the ESP32-Arduino Core, and are not available to the Arduino Uno. You can learn more about these and other hardware-specific functions in the video course.
This concludes the installation and verification of the Arduino IDE support for the ESP32 board. If you want to learn how to install the ESP32 support for the Mac, check out lesson 7.
If your ESP32 Dev Kit contains the CP21012 USB driver chip (most lower-cost dev kits do), you will need to install the USB driver on your computer before you can upload your first sketch. You can learn how to do this in Lesson 9.
Check out our comprehensive resources on the ESP32This guide is part of our comprehensive set of free resources and video courses on the ESP32.
With these resources, you will learn how to use the ESP32 through a series of experiments. We'll start with the basics, like how to use the ESP32 to blink an LED and work our way to more elaborate topics, like using its built-in sensors and communications capabilities.
Comments
Please log in or sign up to comment.