Install PlatformIO - Terrapin-Rocket-Team/SRAD-Avionics GitHub Wiki
Home/Getting Started/Install PlatformIO
PlatformIO is a tool that allows you to compile and upload code to embedded systems. It is a must-have for working with the SRAD Avionics codebase. It is an extension for Visual Studio Code, so you will need to have that installed first.
There is more information about how to run our code specifcally here.
- Open Visual Studio Code.
- Click on the Extensions tab on the left-hand vertical menu bar. It looks like a bunch of squares. You can also press
Ctrl+Shift+X
. - Search for "PlatformIO" in the search bar at the top of the Extensions tab.
- Click the green "Install" button next to the PlatformIO IDE extension.
- Wait for it to install. It may take a minute or two.
PlatformIO is a powerful tool that can be a bit overwhelming at first. Here are some basic things you need to know:
-
PlatformIO Home: This is the main page for PlatformIO. You can access it by clicking the PlatformIO icon on the left-hand vertical menu bar (It looks like an alien head), then go to
Quick Access > PIO Home > Open
. It has a lot of useful information and links to documentation. -
PlatformIO Toolbar: This is a toolbar that appears at the bottom of the window when you have a PlatformIO project open. It has buttons for building (the checkmark), uploading (the right-facing arrow), and monitoring (the electrical plug) your code. It also has a terminal that you can use to run PIO commands.
-
PlatformIO Configuration: The
platformio.ini
file is the configuration file for your project. It tells PlatformIO what board you are using, what libraries you need, and other important information. -
Opening a Project: You can open a PlatformIO project by opening the folder that contains the
platformio.ini
file. PlatformIO will automatically detect the project and set up the environment for you. In our case, this is theSpaceport/23-24/Code/Teensy-based Avionics
folder. -
Environment Selection: An environment is a set of configurations that tell PlatformIO how to compile and upload your code. We have multiple environments set up for different purposes. You can switch between them by clicking on the environment name in the bottom toolbar (e.g.
env:teensy41
). -
Building and Uploading: You can build your code by clicking the checkmark in the bottom toolbar. This will compile your code and check for errors. You can upload your code by clicking the right-facing arrow. This will compile your code and upload it to the board. If oyu previously had the serial monitor open, it will open it again.
-
Serial Monitor: You can open the serial monitor by clicking the electrical plug in the bottom toolbar. This will open a terminal window that shows the output from the board. You can use it to debug your code and see what's happening.