• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » How to Use Arduino with Visual Studio Code on Windows PC

By Abhishek Ghosh April 27, 2024 6:36 am Updated on April 27, 2024

How to Use Arduino with Visual Studio Code on Windows PC

Advertisement

Visual Studio Code (VS Code) has become a popular choice among developers for its lightweight yet powerful features and extensive customization options. While it’s commonly associated with software development, it’s also a versatile platform for programming hardware, including Arduino microcontrollers. In this guide, we’ll explore how to set up and use Visual Studio Code for Arduino development, leveraging its features to streamline the coding process and enhance productivity.

For Mac, we already have a separate guide – Setup Visual Studio Code on Mac For Debugging Arduino & WordPress.

 

Why I Will Use Visual Studio Code For Arduino?

 

It is true that VS Code is not the easiest way to write code for Arduino, ESP32 etc. Indeed, it is meaningless to use anything other than Arduino IDE for too small projects with less than 100 lines of code. Visual Studio Code is required for advanced projects with ESP32 or Arduino boards.

Advertisement

---

Visual Studio Code is available for Windows, macOS, and Linux, making it a versatile choice for Arduino development regardless of your operating system. You can use the same development environment across different platforms, ensuring consistency and compatibility. It is a powerful IDE for writing, editing, and managing your Arduino sketches. It offers syntax highlighting, code completion (IntelliSense), and other features that enhance the coding experience and productivity.

Visual Studio Code seamlessly integrates with version control systems like Git, allowing you to manage your Arduino projects and collaborate with others more effectively. You can commit, push, pull, and merge changes directly from within the editor, keeping your codebase organized and up-to-date.

 

Prerequisites to Use Visual Studio Code for Arduino

 

Before we begin, ensure you have the following prerequisites:

  1. Visual Studio Code installed on your computer. You can download it from Microsoft’s VS Code site.
  2. Arduino IDE installed (required for installing Arduino board definitions and libraries).
  3. Basic familiarity with Arduino programming concepts.
  4. Arduino board connected to your computer via USB.

 

Steps to Use Visual Studio Code for Arduino

 

Visual Studio Code offers extensions to expand its functionality, and there’s an official extension for Arduino development. Follow these steps to install it:

  • Open Visual Studio Code. Initially, you can use the Quiet Light theme.
  • Go to the Extensions view by clicking on the square icon on the sidebar or pressing Ctrl+Shift+X.
  • Search for “Arduino” in the Extensions Marketplace.
  • Click “Install” next to the “Arduino” extension offered by Microsoft.

Set Up Arduino in Visual Studio Code

Once the Arduino extension is installed, you need to configure it to work with your Arduino environment:

  1. Open the Command Palette by pressing Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (Mac). Type “Arduino” and you’ll get the board options including that of ESP32. If your Arduino IDE is configured for ESP32, then you need not do anything more.
  2. Type “Arduino: Initialize” and select “Arduino: Initialize”.
  3. Choose the folder where you want to store your Arduino sketches.
  4. Select your Arduino board from the list of available options.

Create a New Arduino Sketch

Now that your environment is set up, you can create a new Arduino sketch:

  • Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P).
  • Type “Arduino: New Project” and select it.
  • Enter a name for your project and choose the folder where you want to save it.

Once you have opened up an .ino file, VS Code reconfigures it to Arduino mode, which gives access to special functionality in its bottom blue margin, with icons to select the board, port etc and a top bar with an upload option.

Open %APPDATA%\Code\User in Windows explorer, open the settings.json file. This file should at least contain this things:

Vim
1
2
3
4
5
6
{
    "arduino.path": "C:\\Program Files (x86)\\Arduino",
    "arduino.additionalUrls": "https://espressif.github.io/arduino-esp32/package_esp32_index.json",
    "C_Cpp.intelliSenseEngineFallback": "Disabled",
    "C_Cpp.intelliSenseEngine": "Tag Parser",
}

Go to Settings > Workspace > Workbench > Settings Editor and make use that it is using JSON file.

Press CTRL+SHIFT+P then type: “C/CPP: Edit Configurations” then press Enter when the correct setting is highlighted. This will create a file named c_cpp_properties.json, cop paste this content:

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**",
                "C:/Program Files (x86)/Arduion/hardware/arduino/avr/cores/arduino",
                "C:/Program Files (x86)/Arduino/hardware/arduino/avr/libraries/EEPROM/src",
                "C:/Program Files (x86)/Arduino/hardware/arduino/avr/libraries/HID/src",
                "C:/Program Files (x86)/Arduino/hardware/arduino/avr/libraries/SoftwareSerial/src",
                "C:/Program Files (x86)/Arduino/hardware/arduino/avr/libraries/SPI/src",
                "C:/Program Files (x86)/Arduino/hardware/arduino/avr/libraries/Wire/src",
                "C:/Program Files (x86)/Arduino/hardware/arduino/avr/libraries/SPI/src"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE",
                "F_CPU=16000000L",
                "ARDUINO=10805",
                "ARDUINO_AVR_UNO",
                "ARDUINO_ARCH_AVR"
            ],
            "compilerPath": "C:/Program Files (x86)/Arduino/hardware/tools/avr/bin/avr-gcc.exe",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "intelliSenseMode": "clang-x64"
        }
    ],
    "version": 4
}

Save it and launch VS Code as administrator.

Source of above ideas is this: https://github.com/microsoft/vscode-arduino/issues/438

Do not forget to add %SystemRoot%\system32 and %SystemRoot%in your PATH (by opening “Edit environment variable” from Windows search function). Once it was more difficult settings to find out.

How to Use Arduino with Visual Studio Code on Windows PC

Write and Upload Your Arduino Code

  • Open the .ino file created in your project folder.
  • Write your Arduino code in the editor.
  • Connect your Arduino board to your computer via USB.
  • Press Ctrl+Alt+U (Windows/Linux) or Cmd+Alt+U (Mac) to compile and upload your code to the Arduino board.

Monitor Serial Output

Visual Studio Code allows you to monitor the serial output of your Arduino board directly within the editor:

  1. Press Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (Mac) to open the Command Palette.
  2. Type “Arduino: Open Serial Monitor” and select it.
  3. The Serial Monitor panel will open at the bottom of the editor, displaying the serial output from your Arduino board.

 

Conclusion

 

Setup of VS Code for the first time is painful due to a lot of bugs. But it is worth the time investment.

Tagged With question4n0 , как прогать ардуино на vs code в 2024
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to How to Use Arduino with Visual Studio Code on Windows PC

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • Arduino C Programming Tutorial + OS X CrossPack-AVR IDE

    We Can Easily Start Arduino C Programming Tutorial With OS X CrossPack-AVR IDE. With Plain Homebrew We Can Install the IDE & Upload Code.

  • Changing Data With cURL for OpenStack Swift (HP Cloud CDN)

    Changing Data With cURL For Object is Quite Easy in OpenStack Swift. Here Are Examples With HP Cloud CDN To Make it Clear. Official Examples Are Bad.

  • Keyboard Shortcuts in Windows 7

    Previously we wrote about some keyboard shortcuts, here are more Keyboard Shortcuts in Windows 7 to facilitate users to use Microsoft Windows 7 more easily.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

vpsdime

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Cloud-Powered Play: How Streaming Tech is Reshaping Online GamesSeptember 3, 2025
  • How to Use Transcribed Texts for MarketingAugust 14, 2025
  • nRF7002 DK vs ESP32 – A Technical Comparison for Wireless IoT DesignJune 18, 2025
  • Principles of Non-Invasive Blood Glucose Measurement By Near Infrared (NIR)June 11, 2025
  • Continuous Non-Invasive Blood Glucose Measurements: Present Situation (May 2025)May 23, 2025
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2026 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy