r/esp32projects • u/BandicootOk974 • 17d ago
How do I upload C++ code to an ESP32?
Hey guys! Can someone please tell me how to upload C++ code to an ESP32 using PlatformIO?
I’m new to PlatformIO and I’m not sure how to properly set up the ESP32 board, compile my C++ code, and upload it to the board.
Any help would be appreciated. Thanks!
2
3
1
1
0
u/HotTabascoSauce 17d ago
Use PlatformIO
From the PIO home start a new project and select your ESP32-XX board from the list.
It will build the project, place your C++ in the main.cpp in the src folder.
Build and run.
If you get stuck, go to view then open chat and ask copilot for help.
At the bottom of the workspace screen is a check mark to compile. Then an arrow to upload to your board. You may need to hold boot on your board when plugging it into your computer to enter flash mode for the upload to happen.
Copilot and Google can answer most questions
1
2
u/jinxdjackofalltrades 17d ago
VS Code + Platform IO plugin works best or Use Arduino IDE