Skip to content

Get Started with PlatformIO

Install the software


Install Visual Studio Code

Search for Visual Studio Code download on Google or enter the https://code.visualstudio.com/download, select the version compatible with your computer system and download Visual Studio Code installer. In this instructions we are selecting Windows.

Get_Started_with_PlatformIO_1

Double-click the VSCodeUserSetup file to install the Visual Studio Code.

get-started-with-platformio-2

Accept the license agreement and go next.

get-started-with-platformio-3(1)

Accept the default location or click 'Browse...' to change the installation location.

get-started-with-platformio-4

Accept the resting default option and click 'Next >'...

Click install and waiting for the installation ...

get-started-with-platformio-5

Click 'Finish' to exit the installation and (by default) launch Visual Studio Code:

get-started-with-platformio-6

Open Visual Studio Code and open Extension Manager.

get-started-with-platformio-7

Install Python

Search for 'Python' and install.

get-started-with-platformio-8

Install PlatformIO

Search for 'PlatformIO' and install.

get-started-with-platformio-9

Install Driver(Optional)

If you have not installed the USB driver, you need to install it: https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers

Run a Program


In this case, we'll run an LED_Blink demo on an Arduino Uno to check that the installation is correct.

  1. Connect the Arduino Uno to the computer with a USB cable.

  2. Click the PlatformIO icon, click QUIK ACCESS 'Open', then click '+New Project'.

    get-started-with-platformio-10

  3. Add a project name. Select "Arduino Uno" for the board and Arduino for the framework.

    get-started-with-platformio-11

  4. Write the main program in main.cpp.

    get-started-with-platformio-12

    #include "Arduino.h"
    void setup(){
       // initialize digital pin LED_BUILTIN as an output.
       pinMode(2, OUTPUT);
    }
    
    // the loop function runs over and over again forever
    void loop(){
       digitalWrite(2, HIGH); // turn the LED on (HIGH is the voltage level)
       delay(1000);                // wait for a second
       digitalWrite(2, LOW); // turn the LED off by making the voltage LOW
       delay(1000);                // wait for a second
    }
    
  5. After the code is written, we can then compile the program.

    get-started-with-platformio-13

  6. Select the serial port and upload the code.

    Here we select Auto. The software will automatically select the corresponding serial port for program download. If the automatically selected serial port is incorrect, you can manually select the correct serial port.

    get-started-with-platformio-14

  7. Click the upload button to up the program to the board.

    get-started-with-platformio-15

  8. The program will run on the board!

    get-started-with-platformio-16