Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why Won't Arduino Intellisense Work in VSCode?

I installed the Arduino extension Arduino extension in VSCode which is supposed to include intellisense however it doesn't seem to be working. This is my c_cpp_properties.json:

c_cpp_properties.json

And here is an example of the intellisense not working:

intellisense not working

As you can see, intellisense should be able to predict the keyword Serial however it does not.

I have Command Line Tools installed. Is there a missing directory that I should include in the "includePath" property.

like image 915
Christopher Berry Avatar asked Jan 27 '23 16:01

Christopher Berry


1 Answers

add the missing lines into your c_cpp_properties.json (and change some filename to mac equivalent) especially with "defines": [ "USBCON" ] to make Serial class to work with intellisense

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "<arduino ide installation folder>\\tools\\**",
                "<arduino ide installation folder>\\hardware\\arduino\\avr\\**",
                "<arduino ide installation folder>\\hardware\\tools\\**",
                "<arduino ide installation folder>\\hardware\\arduino\\avr\\cores\\arduino"
            ],
            "forcedInclude": [
                "<arduino ide installation folder>\\hardware\\arduino\\avr\\cores\\arduino\\Arduino.h"
            ],
            "intelliSenseMode": "msvc-x64",
            "compilerPath": "<arduino ide installation folder>\\hardware\\tools\\avr\\bin\\avr-gcc.exe",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "defines": [
                "USBCON"
            ]
        }
    ],
    "version": 4
}
like image 198
C.H. Avatar answered Mar 07 '23 21:03

C.H.