'How to configure Visual Studio Code includePath for Arduino and Teensy
I'm working with Arduino and Teensy boards from inside VS code. I can build and program everything fine, but the highlighting and code following functions built into VS Code don't work.
Previously, my custom headers weren't loading or highlighting, but this answer got that working for me. Now I have the right libraries on my include path (and I can click and follow them to the correct source) but some names still don't work:
My includePath appears to be configured correctly, as I mentioned I can follow the includes and it opens the correct sources:
"includePath": [
"${workspaceFolder}/**",
"C:/Program Files (x86)/Arduino/**",
"C:/Program Files (x86)/Arduino/hardware/teensy/avr/cores/teensy/**",
"C:/Program Files (x86)/Arduino/hardware/teensy/avr/libraries/ADC/**",
"C:/Program Files (x86)/Arduino/hardware/arduino/avr/cores/arduino/**",
"C:/Program Files (x86)/Arduino/hardware/arduino/avr/variants/standard/**",
"C:/Program Files (x86)/Arduino/hardware/tools/avr/lib/gcc/avr/5.4.0/include/**"
]
I can confirm the header is on the includePath and has the names defined I'm looking for:
Somehow VS Code is still saying the identifier is undefined.
Any ideas?
Solution 1:[1]
Just install the Arduino extension and run vscode command Arduino: initialize. You will need to select board and
File .vscode\c_cpp_properties.json and .vscode\arduino.json will automatically created.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | CircleOnCircles |



