How to move Arduino IDE dev work to VSCode?
To move your Arduino development work from the Arduino IDE to Visual Studio Code (VS Code), you can use the Arduino extension for VS Code developed by Microsoft. This allows you to write, compile, and upload Arduino code directly in VS Code, with more powerful editing and debugging tools.
Step-by-Step: Move Arduino Projects to VS Code
Install VS Code
Download and install VS Code from:
https://code.visualstudio.com/
Install the Arduino Extension
-
Open VS Code
-
Go to Extensions (
Ctrl+Shift+X
) -
Search for “Arduino” (by Microsoft)
-
Click Install
This extension provides:
-
Syntax highlighting
-
IntelliSense
-
Uploading/flashing support
-
Serial monitor
Install Arduino IDE (if not already installed)
VS Code uses the Arduino CLI under the hood, so make sure the Arduino IDE is installed and accessible in your system path.
Or install the Arduino CLI directly from:
https://arduino.github.io/arduino-cli/
Configure Arduino Extension
-
Press
Ctrl+Shift+P
and type:Arduino: Board Manager
-
Select your board (e.g., Arduino Uno, Nano, ESP32)
-
Press
Ctrl+Shift+P
again →Arduino: Select Serial Port
If needed, set the path to your Arduino installation:
Open or Create Arduino Project
-
Create or open a folder with your
.ino
file -
Save the
.ino
file inside the folder with the same name as the.ino
file
Example:
🛠 If you open the folder, VS Code should automatically recognize it as an Arduino project.
Use Arduino Commands in VS Code
Use Ctrl+Shift+P
(Command Palette) and type:
-
Arduino: Verify
– to compile -
Arduino: Upload
– to upload to board -
Arduino: Open Serial Monitor
– to see output
Or use the Arduino toolbar buttons at the top.
(Optional) Use PlatformIO for Advanced Projects
For advanced features (debugging, library mgmt, multi-platform), consider using PlatformIO:
-
Install PlatformIO extension in VS Code
-
Create a new PlatformIO project
-
Import your Arduino
.ino
code intosrc/main.cpp
and set up your environment
Summary
Step | Action |
---|---|
1 | Install VS Code |
2 | Install Arduino extension |
3 | Configure board and serial port |
4 | Open or create project folder |
5 | Use command palette to verify/upload |
6 | (Optional) Use PlatformIO for more power |
评论
发表评论