Text Editor#

Any text editor, like Notepad, TextEdit, Notepad++, etc., can be used to write C/C++ code for the microcontroller. However, we will use VSCode (Visual Studio Code) in this class because it has a great deal of extra functionalities that makes writing the code easier. These functionalities include syntax highlighting, suggestions, Auto-Complete, and many more. It also interfaces with CMake so that the code can be compiled into a binary with a single click. Following are the steps for setting up VSCode properly.

MacOS#

Windows/Linux#

  • Download the installer for VSCode from https://code.visualstudio.com/download for your operating system and run it.

  • Follow the steps shown below. Make sure to tick ‘Open with VSCode’

    1

    2

    3

    4

    5

    6

    7

    8

    9

    10

    11

  • Install `WSL’ extensions.

    1

    2

    3

    4

    5

  • Follow the images below to open WSL in VSCode. Note that when you switch to WSL in VSCode, you’ll see WSL:Ubuntu written in the bottom left blue colored area.

    1

    2

    3

  • Install ‘C/C++ Extension Pack’ in WSL.

    1

    2

    3

    4

    5