Does anyone use Visual Studio Code for building the firmware?

Does anyone use Visual Studio Code to build or program Kaleidoscope or the .ino firmware? I’m trying to build the firmware with Visual Studio Code with the Microsoft Arduino extension, but am a little lost trying to get it work properly.

I have the Arduino IDE installed (a requirement for the VSC extension), and I can load the Model01 Firmware.ino and verify it successfully, but the editor show me plenty of errors in the .ino file which I don’t understand (see attached image). I suspect I have some configurations that are wrong, but interestingly enough, the .ino file verifies successfully.

I used the Board Manager to select the Keyboardio libraries and I presume that’s what allowed me to compile it, but ideally, I’m looking to have all the sources in Visual Studio and be able to build it all from there. I’d like to leverage the Inteliisense/autocomplete/etc for development purposes.

What is everyone’s typical development platform/setup? Is anyone using an IDE?

Thanks,

Eric

I initially used the Arduino IDE to set things up. While I do use VS Code for most of my other coding, I spent about 10 minutes trying to set it up in VS Code and gave up since the firmware is not something I will spend a ton of time editing. Arduino worked right away with very minimal setup. For reference, I found after my initial update of my firmware and a 6ish weeks of small tweaks, I’m not changing it much.

On the positive side, since I don’t use Arduino IDE for anything else, whenever I open the program the firmware is loaded up and ready to edit.

I have used VS Code for building my custom firmware.
However I didn’t have any plugins Arduino / C++ or similar.

I tried installing the plugins now since new versions of VS Code has started suggesting them for me, based on the file types.

I didn’t get it to work. So I just uninstalled the plugins and continued without them.

Just use good engineering practise. Make small changes. Test often. You won’t need anything but a good text editor.

I use it and get the same error messages you get when I hover over a method while holding ctrl. But jumping to the definition (ctrl + left mouse click) works fine and I get auto completion as well when typing.

I only installed Arduino, VSCode (with the Arduino plugin and C++ plugin) and never tried to get rid of the errors since it works good enough and I run it in a Ubuntu VM which I only use to flash the Firmware and nothing else (my main OS is Windows 7).

Here is a photo of my CPP settings of the project (everything was set automatically):

To set up in VS Code without errors you can follow these steps:

Download the extension https://marketplace.visualstudio.com/items?itemName=vsciot-vscode.vscode-arduino

Use VS Code’s Command Palette (Ctrl+Shift+P) and type Arduino to see the Arduino commands list.

Then use the following commands:

  • “Arduino: Change Board Type ” and then select “Keyboardio Model 01”
  • “Arduino: Change Serial Port ” and choose the COM port your keyboard uses (mine is COM5 for example)

Go into you VS Code setting.json and add this line:

“C_Cpp.intelliSenseEngine”: “Tag Parser”,

That’s it! The Arduino Extension adds 2 buttons on the top right for verifying and updating if you don’t want to use the Command Palette.

Setting is up in VS Code is easy once you know the trick. You can just follow these steps:

Download the extension https://marketplace.visualstudio.com/items?itemName=vsciot-vscode.vscode-arduino

Use VS Code’s Command Palette (Ctrl+Shift+P) and type Arduino to see the Arduino commands list.

Then use the following commands:

  • “Arduino: Change Board Type ” and then select “Keyboardio Model 01”
  • “Arduino: Change Serial Port ” and choose the COM port your keyboard uses (mine is COM5 for example)

Go into you VS Code setting.json and add this line:

“C_Cpp.intelliSenseEngine”: “Tag Parser”,

That’s it! The Arduino Extension adds 2 buttons on the top right for verifying and updating if you don’t want to use the Command Palette.

1 Like