training-labs

Microsoft Visual Studio Code and Arduino

The editor Visual Studio Code (VS Code)by Microsoft gives some handy features for editing Arduino embedded code while requiring minimal additional configuration. You can download VS Code and then search “Arduino” in the marketplace (Marketplace symbol on the left of the editor).

Initializing a sketch

If you open the directory that has your .ino sketch and open the .ino file, the Arduino extension will make some extra buttons appear for verifying and uploading the sketch. You can then strike F1 to open the command menu and search for Arduino: Initialize. Choose the Catena 4410 as the board (hopefully you installed that BSP and our libraries during the basic IDE setup) and some files will appear: .vscode/c_cpp_properties.json and .vscode/arduino.json. Specifying a build directory in .vscode/arduion.json will potentially save you time because the compiler can re-use old, but still usable output. Do that by adding a line such as

"output": "./build",

to that file to make it look like this:

{
    "sketch": "ttn_otaa_highlevel.ino",
    "board": "mcci:samd:mcci_catena_4410",
    "output": "./build",
    "configuration": "lorawan_region=us915,lorawan_network=ttn,lorawan_subband=default"
}