Search code examples
visual-studio-codearduino-ide

Cannot find Arduino IDE path. In Visual Studio Code


I wants to use Arduino in vs code Visual Studio Code.

I installed arduino IDE on my local machine on C:\Program Files\Arduino IDE I also added arduino path my Visual Studio Code's setting .json

"arduino.path": "C:\\Program Files\\Arduino IDE",

setting .json

I am using arduino extension.

This is the pic of extension

Any suggestion or recommendations would greatly aid me. I've been struggling to find a solution for this problem for 6 hours.


Solution

  • This was giving me issues for the longest time, too. It seems that the Arduino 2.X IDE doesn't work well with VSCode.

    To resolve, use the legacy IDE (Arduino 1.8.X). First, uninstall the 2.X version of Arduino. As of February 2023, you can download the legacy version by going to the Arduino Downloads page and scrolling down to the "Legacy IDE (1.8.X)" section. There's a few different download options. I opted for the one labeled "Windows Win 7 and Newer" since it's a neatly contained executable to install Arduino.

    enter image description here

    From here, run the executable and install normally. I also reinstalled the Arduino plugin in the Visual Studio marketplace (not sure if necessary, but it doesn't hurt). There's at least three places you could potentially enter the arduino.path:

    1. The one in YOUR PROJECT FILEPATH/.vscode/settings.json
    2. The one in the VS Code User Settings (File>Preferences>Settings> User tab> Search for arduino.path in the search bar)
    3. Same as above, but on the "Workspace" tab instead of "User"

    For me, leaving all three empty worked fine. I believe that's because the installer added Arduino to the Windows Path variable. Here's a related post, though, where someone had to configure the path variable in case that doesn't work for you.