Using PlatformIO to program code on the ESP32
In this section, we will build and upload code onto the ESP32 via the PlatformIO IDE. Then, we will observe the messages printed locally on our Macbooks, and verify whether the outcome aligns with our logic.
Here are the steps that are to be followed:
- Launch the PlatformIO IDE in VS Code, go to the project you made in Chapter 10, look for
main.cpp
undersrc
in theproject
folder, copy the code you got from the ChatGPT conversation window, and put the code inmain.cpp
, as shown here:
Figure 11.3 – Copying the main.cpp code from ChatGPT to PlatformIO
- Locate the
platformio.ini
file in your project folder, then copy theplatformio.ini
contents from the ChatGPT conversation window and paste them in the platformio.ini file here.
Figure 11.4 – Copying platformio.ini code from ChatGPT to PlatformIO
- In the
platformio.ini
file example, there are...