The Arduino IDE
There’s a bit of setup involved in getting Arduino code to run. Here are the steps I followed.
Download the Arduino IDE here, then follow these steps to run code on an ESP32:
- In
Preferences, paste the following link intoAdditional boards manager URLs:
https://dl.espressif.com/dl/package_esp32_index.json
-
In
Tools > Boards > Boards Manager, search for “esp32”. There should be one result, “esp32 by Espressif Systems”—install it. -
Select the ESP32 board by clicking
Tools > Boards > esp32 > TTGO T1. -
In
Tools > Manage Libraries, search for “TFT_eSPI Bodmer”. Install the one with the title “TFT_eSPI”. -
In
Preferences, copy the filepath specified under “Sketchbook location”.cdinto that directory in your terminal/terminal emulator. There should be alibrariesdirectory in there.cd libraries/TFT_eSPI, then openUser_Setup_Select.hwith a text editor. In this file, there should be lines like this:
#include <User_Setup.h> // Default setup is root library folder
...
//#include <User_Setups/Setup25_TTGO_T_Display.h> // Setup file for ESP32 and TTGO T-Display ST7789V SPI bus TFTUncomment the second line, and comment the first:
//#include <User_Setup.h> // Default setup is root library folder
...
#include <User_Setups/Setup25_TTGO_T_Display.h> // Setup file for ESP32 and TTGO T-Display ST7789V SPI bus TFTNow, you should be ready to run code on your ESP32!*
*I had some difficulty getting code to export from my Mac, if your compilation
is failing with an error message that ends with A fatal error occurred: Failed
to write to target RAM, try following the steps in
this issue comment.