Arduino and Visual Code

Dusting off my blog here…it’s definitely been a while.

 

Today I was pleasantly surprised to find out that I could use the Visual Code with Arduino Sketches. I did, however, run into a couple of hiccups that were easily solvable.

For example, the browse path inside c_cpp_properties.json appeared to be incorrect. With the default path, I was unable to resolve any of the methods used in the Arduino libs. By editing the path to the following things turned out fine:
“C:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr”,”${workspaceRoot}”
Furthermore, filling out the necessary info in the arduino.json file is probably for best and most likely necessary i.e., sketch, port, board, and output.  ProTip – When you create an Arduino Project in Visual Code the first thing you should do is hit F1: ArduinoChange Board Type. This will generate the necessary files needed for the .vscode directory.

Lastly, just make sure that your .ino file matches the name of the directory it lives inside and that you didn’t place the .ino file inside the .vscode directory.

After about 45 mins of messing around, I was able to get a Sketch compiled and running on a STEMTera board (Arduino UNO) from SparkFun Electronics.

More importantly, I am looking forward to finishing up those MAKE: Electronics Projects as I have also purchased Book2.

However, expect to see some Arduino, other Microcontroller, and general circuit posts as well.

Leave a Reply

RSS
Twitter