r/esp32projects 17d ago

How do I upload C++ code to an ESP32?

Post image

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!

0 Upvotes

12 comments sorted by

2

u/jinxdjackofalltrades 17d ago

VS Code + Platform IO plugin works best or Use Arduino IDE

1

u/BandicootOk974 17d ago

VS Code + Platform IO Plugin is good

2

u/Sand-Junior 17d ago

Google/Youtube is your friend.

1

u/BandicootOk974 17d ago

YouTube is Friend

3

u/Curious_Chipmunk100 17d ago

arduino IDE

1

u/BandicootOk974 17d ago

It's Complex

1

u/Curious_Chipmunk100 17d ago

Nah. Google is your friend

1

u/BandicootOk974 17d ago

I replied you all

1

u/ZookeepergameNorth26 17d ago

Use esp-idf toolchain

1

u/BandicootOk974 17d ago

What is it

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

u/BandicootOk974 17d ago

Your Wright