Site Guide

Find your way around the Engineering Club.

Know what you need? Search for a component, concept or project.

Around the site

Start

Labs

TestingExperimental

Build

Club

LearnExperimental

Go a little deeper

Entry points to larger collections. Use Search for individual records.

Learning paths & reference

Inside PiCrawlerExperimental

Inside Inventory

← BASIC

BASIC / Embedded

PlatformIO IDE for VS Code

An embedded-development extension and project build system.

Why use it

The club uses PlatformIO inside VS Code for board environments, firmware builds, uploads, and library management.

  • Arduino-class boards
  • ESP32
  • multi-environment firmware
  • serial monitoring
Windows · macOS · Linuxrequiredactive

Getting started

Install the PlatformIO IDE extension in VS Code. Open PlatformIO Home, create or open a project, and select the environment matching your actual board. For Arduino-framework projects, put the program in src/main.cpp with #include <Arduino.h>, then Build and Upload from that environment in Project Tasks. For serial programs, set monitor_speed in platformio.ini to match Serial.begin, then choose General > Monitor under the same environment in Project Tasks. Close the monitor before uploading if the port is busy.

Check: Build and Upload report SUCCESS, and the board runs the expected program. For Uno/Mega Lab 1, the onboard L LED blinks; change its timing and upload again to confirm.

Start Lab 1 →

Official links

Tool prerequisites

Install these before using this required tool for Lab 1.

Troubleshooting

PlatformIO Home is missing

Confirm the official PlatformIO IDE extension is installed and enabled, wait for its initial setup, and reload VS Code if prompted.

No board port appears

Try a known data-capable USB cable and another USB port. Compare PlatformIO Devices before and after reconnecting. Check the OS device list; if a driver is missing, use the board manufacturer's driver guidance. A power LED alone does not prove data works.

List COM port names

PlatformIO does not detect the board port.

[System.IO.Ports.SerialPort]::GetPortNames()

One or more COM names, such as COM3; no output means none were returned.

No output can mean a charge-only cable, disconnected board, driver problem, or a device that has not enumerated. It does not diagnose which one.

Inspect Windows port devices

A board is powered but no COM port is apparent.

Get-PnpDevice -Class Ports | Select-Object FriendlyName, Status, InstanceId

Rows with a friendly name, status, and instance ID when Ports-class devices exist.

No rows or an error can mean no Ports-class devices, an unavailable PnpDevice cmdlet, or device/driver issues; compare before and after plugging in the board.

Build fails

Check the board and framework in platformio.ini and the selected environment. Read the first compiler error; Arduino-framework main.cpp needs Arduino.h. Wait for first-time tool downloads to finish.

Build succeeds but upload fails

Confirm the physical board matches the selected environment, check the detected port or upload_port, and close serial monitors or other applications holding the port. Reconnect and follow the board's documented boot/reset procedure if needed.

List COM port names

PlatformIO does not detect the board port.

[System.IO.Ports.SerialPort]::GetPortNames()

One or more COM names, such as COM3; no output means none were returned.

No output can mean a charge-only cable, disconnected board, driver problem, or a device that has not enumerated. It does not diagnose which one.

PlatformIO Monitor text is unreadable

Set monitor_speed in platformio.ini to match Serial.begin in the program (9600 for the Intro Lab serial programs).

Optional diagnostic commands

Check PlatformIO CLI version

Windows · PowerShell · Using a project-specific PlatformIO terminal workflow.

pio --version

A PlatformIO Core version line.

Command not found does not prove the VS Code extension is absent; its Core can be available only inside its integrated terminal.

Related labs

Related tools and references