Tutorial

RoboRider Labs – PlatformIO in VS Code (Classroom)

PlatformIO in VS Code β€” Speedrun Setup ⚑

🧭 Why PlatformIO?

One editor. Many boards (Arduino, ESP32, more). Auto-libs. Clean uploads. Great for bigger projects.

Goal: open VS Code β†’ install PlatformIO β†’ make a Blink project β†’ upload. Mini win unlocked. 🎯

πŸ’» Install VS Code + PlatformIO

  1. Install Visual Studio Code (your OS).
  2. Open VS Code β†’ left sidebar Extensions (squares icon).
  3. Search β€œPlatformIO IDE” β†’ click Install.
  4. Restart VS Code if it asks.
⚠️ If you’re on school PCs, you may need the portable VS Code or IT help to install.

πŸ†• Make a Blink Project

  1. Click the alien head icon (PlatformIO) β†’ New Project.
  2. Name: Blink.
  3. Board: pick yours (e.g., Arduino Uno or ESP32 Dev Module).
  4. Framework: Arduino.
  5. Create. Wait while it sets things up.

πŸ’‘ Paste Blink Code

Open src/main.cpp and paste:

#include <Arduino.h>
void setup(){ pinMode(LED_BUILTIN, OUTPUT); }
void loop(){ digitalWrite(LED_BUILTIN, HIGH); delay(500); digitalWrite(LED_BUILTIN, LOW); delay(500); }
πŸ’‘ On ESP32, the onboard LED is often on GPIO2. Replace LED_BUILTIN with 2 if needed.

πŸš€ Upload

  1. Plug in your board (use a data-capable USB cable).
  2. Bottom bar: click βœ“ (Build) β†’ then β†’ (Upload).
  3. LED blinking? You did it. πŸ™Œ
⚠️ ESP32: If it says β€œFailed to connect,” hold BOOT, click Upload, release when β€œConnecting…” shows.

🧯 Quick Fixes

  • No port? Try another USB cable/port; install CP210x/CH34x driver.
  • Wrong board? Edit platformio.ini β†’ set the correct board = <name>.
  • Serial Monitor busy? Close it before uploading.

πŸŽ‰ Next Steps

  • Add libraries (PIO Home β†’ Libraries).
  • Make multiple environments for different boards.
  • Try Wi-Fi examples on ESP32.

Welcome to the pro lane. 🏎️

RoboRider Labs β€’ VS Code + PlatformIO