How to setup and use VS-Code (Windows) for Arduino Programming?

Thread Starter

Shafty

Joined Apr 25, 2023
131
Hi All,
I am a very new user to Arduino Programming but have been developing Windows programs for more than a decade. Need help in installing, setting up and Using the VS-Code utility to code, program and build the Arduino Sketches using Arduino Programming Language code in VS-Code.
 

Ya’akov

Joined Jan 27, 2019
8,171
Why not use the free Arduino IDE?
VS Code is an open source port of Visual Studio, the IDE environment which would be most familiar to the TS. PlatformIO is a very popular IDE for embedded applications that includes excellent Arduino support. The combination has advantages—as an IDE environment—over the Arduino IDE, and VS Code supports just about any language you might use in the same environment as Arduino development.

Overall, for the TS, it has many pluses over the Arduino IDE option.
 

Danko

Joined Nov 22, 2017
1,737
Need help in installing, setting up and Using the VS-Code utility to code, program and build the Arduino Sketches using Arduino
Getting started with Visual Studio Code
https://code.visualstudio.com/docs/introvideos/basics

Visual Studio Code documentation
https://code.visualstudio.com/docs

How to Use VS Code for Creating and Uploading Arduino Sketches
https://circuitstate.com/tutorials/how-to-use-vs-code-for-creating-and-uploading-arduino-sketches/

How to Use Visual Studio Code for Arduino
https://maker.pro/arduino/tutorial/how-to-use-visual-studio-code-for-arduino

Arduino and Visual Studio Code: Getting Started
https://betterprogramming.pub/arduino-and-visual-studio-code-getting-started-1362539ea9d3

PROGRAMMING ARDUINO ON VISUAL STUDIO CODE EDITOR WITH PLATFORM.IO OR ARDUINO EXTENSION
https://www.electronics-lab.com/pro...-arduino-extension-visual-studio-code-editor/

etc....
 

Thread Starter

Shafty

Joined Apr 25, 2023
131
Step1: Installed the VS-Code
Step2: Installed the Arduino Extension (Microsoft)
Step3: Creating an ino file
Getting the below popups... What to do? How to fix these?
1682683753063.png]
 

Danko

Joined Nov 22, 2017
1,737

SamR

Joined Mar 19, 2019
4,819
My question is, does it support all the libraries that are integrated into the Arduino IDE? Writing the code is easy, IF you have the libraries to support the devices needed for the circuit.
 

Thread Starter

Shafty

Joined Apr 25, 2023
131

Ya’akov

Joined Jan 27, 2019
8,171
My question is, does it support all the libraries that are integrated into the Arduino IDE? Writing the code is easy, IF you have the libraries to support the devices needed for the circuit.
From PlatformIO docs:

The choice between Arduino IDE and PlatformIO IDE depends on the specific needs and requirements of the project and the user.
Arduino IDE is a simple and easy-to-use development environment that is specifically designed for the Arduino platform. It provides a straightforward and intuitive interface for writing and uploading code to the board. The Arduino IDE is well-suited for simple projects and for users who are new to the world of microcontrollers.

PlatformIO IDE, on the other hand, is a more powerful and feature-rich development environment. It supports a wider range of microcontroller platforms and development boards, and provides a comprehensive set of tools for Library Management, Continuous Integration, Unit Testing, and Debugging. PlatformIO IDE is well-suited for more complex projects and for experienced users who need more advanced features.

In conclusion, it depends on the project requirements and user experience. If you need a simple and easy-to-use environment for a small project, Arduino IDE may be the better choice. If you need a more powerful and feature-rich development environment for a larger project that uses the Arduino framework, PlatformIO IDE may be the better choice.
 

Ya’akov

Joined Jan 27, 2019
8,171
By the way, if you run into problems with PaltformIO, the PlatformIO-specific forums, Discord servers, and documentation will be much more suitable than AAC.

When you are having trouble with the Arduino code or circuits, AAC will be perfect.
 

Ya’akov

Joined Jan 27, 2019
8,171
For those following but not familiar with PlatformIO, here's something to consider.

PlatformIO is not limited to VS Code, it can be used in other IDEs though they do recommend PlatformIO for VS Code for a number of reasons.

PlatformIO is not an "Arduino IDE", it's an embedded IDE that supports quite a few frameworks, Arduino being among them. From the PlatformIO docs:

So for those who use one or more other supported frameworks, PlatformIO looks even better.
 
Top