Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

VSCode (Visual Studio Code) is probably the most popular IDE for software development because of its versatility and lightweight framework. You can go from writing C++ to Python to Javascript to HTML in a single IDE, with tools you can download for formatting and writing each language. For the software development in NER, we typically prefer using Visual Studio Code, just because it is lightweight and easy to install and doesn’t end up with weird file names or project files like some other IDEs. VSCode also works on macOS, Linux, and Windows, and operates pretty much the same across all of them. VSCode is simple, effective, cross-platform, and powerful.

Downloading VSCode

To download VSCode, you just need to go to this link to install it on your machine. Then follow the instructions in the installation wizard, making sure to add any “open with code” options you see. For Windows, you may also want to add to PATH.

Little VSCode Overview

VSCode is essentially just a normal text editor on steroids. On the left side of the screen, you got some of the main functionality of the IDE. VSCode works best when you open a directory, which you can do by clicking File in the top left, and then choosing Open Folder. You can also edit single files by opening a file with VSCode, or by going to File and then Open File.

In order, the icons under the blue VSCode logo in the top left are:

  1. File Explorer

    1. Let’s you open, make, delete files and directories

  2. Search

    1. Let’s you search the whole project for a word or phrase, and let’s you replace it too

  3. Source Control

    1. Integrates with Git to help you track what changes need to be added/committed

    2. I’m not a big fan of using this, I like using Git in the Command Line better

  4. Debug

    1. Allows you to run your code step by step to find bugs

    2. I haven’t really ever used this, it is especially useless for embedded code and firmware

  5. Remote Explorer

    1. Essentially Docker integration

  6. Extensions

    1. This is the true bread and butter of VSCode, where you can download extensions that the community/VSCode has made to help format your code, check for syntax errors, build code, etc.

    2. There’s even an extension where you can get a virtual pet for while you code

    3. This is where you can install PlatformIO

  7. Testing

    1. This is where users can write and utilize testing scripts/frameworks to test their code before releasing it

  8. The last icon is the PlatformIO icon, which I’ll go into more depth about in the next section

Installing PlatformIO

To install PlatformIO, navigate to the Extensions tab on the left and search for PlatformIO, then install it. That is essentially it. I have seen a bug where you can’t have spaces in your username, specifically for Windows, so keep in mind that this is just an open-source project and might have a few bugs.

Little PlatformIO Overview

PlatformIO “projects” are defined by directories with a valid platformio.ini file in them. For example, the Embedded_Code repo has 2 PlatformIO projects in it: MPU and TCU. To open the PlatformIO project, either click on File -> Open Folder then open the directory, or (for Windows) right-click in the file explorer in the project directory and click Open with Code if you have the option set up for VSCode. You can also open VSCode via the CLI by typing code <Directory you want to open>.

Above is a picture of the basic PlatformIO UI bar. The buttons that matter the most (starting from the Home Icon near the middle bottom) is

  1. PlatformIO: Home

    1. This brings you to the homepage for setting up a PlatformIO project/libraries

  2. PlatformIO: Build

    1. This compiles your code to make sure it builds

  3. PlatformIO: Upload

    1. This actually uploads the code to the board

    2. Note you need to be connected to the board via a serial connection

  4. PlatformIO: Serial Monitor

    1. This begins a serial monitor of whichever COM/dev port the board is using

    2. This is where you can view Serial.print("") statements, similar to Arduino IDE

  5. PlatformIO: New Terminal

    1. Just opens a new terminal

  • No labels