Skip to main content

VSCode + PlatformIO Setup

Visual Studio Code LogoPlatformIO Logo

Why PlatformIO?

PlatformIO is a professional embedded development ecosystem that runs inside VS Code. It supports Arduino, ESP-IDF, and many other frameworks across hundreds of boards — with built-in library management, IntelliSense, and debugging.

Prerequisites

  • A computer running Windows, macOS, or Linux.
  • A supported board (Arduino, ESP32, ESP8266, Raspberry Pi Pico, etc.) and a USB data cable.

1. Install Visual Studio Code

Download and install Visual Studio Code for your operating system.

2. Install the PlatformIO IDE Extension

  1. Open the Extensions view (Ctrl+Shift+X).
  2. Search for PlatformIO IDE and click Install.
  3. Wait for PlatformIO Core to finish installing — this can take a few minutes on first run.

3. Create a New Project

  1. Open the PlatformIO Home tab and click New Project.
  2. Give your project a name, then select your board and framework (Arduino or ESP-IDF).
  3. Click Finish — PlatformIO downloads the required toolchain and libraries automatically.

Board Configuration Examples

Every PlatformIO project is configured through a platformio.ini file in the project root. Instead of a Boards Manager URL (like the Arduino IDE needs for third-party boards), PlatformIO automatically downloads the matching platform/toolchain package the first time you build a given [env:...] — no manual setup step required. Here's a [env:...] block for each common board:

[env:uno] ; Arduino Uno
platform = atmelavr
board = uno
framework = arduino

[env:esp32dev] ; ESP32 Dev Module
platform = espressif32
board = esp32dev
framework = arduino

[env:d1_mini] ; ESP8266 (Wemos D1 Mini)
platform = espressif8266
board = d1_mini
framework = arduino

[env:pico] ; Raspberry Pi Pico
platform = raspberrypi
board = pico
framework = arduino

[env:rpipicow] ; Raspberry Pi Pico W
platform = raspberrypi
board = rpipicow
framework = arduino

You can keep multiple [env:...] sections in the same platformio.ini and build/upload to whichever one matches the board currently plugged in — no need for separate projects per board.

4. Build & Upload

Use the bottom status bar icons, or the command palette:

  • Build: compiles your project (checkmark icon).
  • Upload: flashes the compiled firmware to your board (right-arrow icon).
  • Serial Monitor: opens a serial console (plug icon).

Next Steps

➡️ Get Started with Arduino · Get Started with ESP32 & ESP8266 · Get Started with Raspberry Pi Pico


Comments