Arduino-cli and VSCode
With the second try I was successful to get arduino-cli and VSCode to work together.
In the past I was working and testing in the Arduino IDE and copying the code manually to VSCode to sync it via git. To be able to work directly in VSCode would save some time so I invested some time into it.
Loosely covered my steps and pain points were:
-
Install arduino-cli and configure VSCode to use it in the Arduino extension settings
-
I added the board urls also to the list in the settings.json in VSCode (Arduino extension settings)
"arduino.additionalUrls": [
"https://arduino.esp8266.com/stable/package_esp8266com_index.json",
"https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json"
],
- For esp32/esp8266 programming add the boards to arduino-cli:
arduino-cli config init --additional-urls \
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json,\
https://arduino.esp8266.com/stable/package_esp8266com_index.json
arduino-cli core update-index
-
Every sketch must be in a separate folder named exactly like the .ino file of the sketch itself.
-
Press “F1” type in “Select sketch” and select the sketch you want to verfiy. A hidden subfolder .vscode with a file arduino.json will be created. Add (name the folder as you like):
"output": "../build"