This repo has some Arduino examples.
- Install C++ Visual Code Plugin
- Install Arduino IDE
- Install Visual Code Arduino Plugin
- At the project root, create the file
.vscode/c_pp_properties.json
with the following content:
{
"configurations": [
{
"name": "Mac",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"macFrameworkPath": [],
"compilerPath": "/usr/local/bin/gcc-10",
"cStandard": "gnu17",
"cppStandard": "gnu++14",
"intelliSenseMode": "macos-gcc-x64",
"browse": {
"path": [
"/Applications/Arduino.app/Contents/Java/hardware",
"/Applications/Arduino.app/Contents/Java/libraries"
]
}
}
],
"version": 4
}
(This is the MacOS version, Windows and Linux versions may have different values, see this issue).
To switch between sketches, modify the .vscode/arduino.json
file.
In this example, you need to change the sketch
property.
{
"board": "arduino:avr:uno",
"programmer": "avrisp",
"sketch": "push-button/push-button.ino"
}