Quick start guide to arduino programing in visual studio

New Users Please Read This

The Arduino for Visual Studio add-in provides many ways to create, manage, compile and upload Arduino sketch programs using Visual Studio. The add-in extends the Visual Studio menus and tool bars by providing easy to use options that ensure your sketch programs adhere to the Arduino rules.

To avoid confusion, new users should use the Arduino commands in Visual Studio in preference to standard visual studio commands. If you are new to both Arduino and to Visual Studio then you MUST use the Arduino commands because you won't know the Arduino rules. You will see that the Arduino commands have an Arduino icon next to them.

First Time User Guide

After you have installed arduino, run arduino once, installed this application and opened visual studio to set your "tools>options>visual micro>arduino>arduino application" (arduino.exe location) you can test arduino in visual studio these ways:-

Method A - Create new arduino sketch (automatic mode)

Open visual studio. From the "File>New" menu select "Arduino project". When prompted, enter the name of a new arduino sketch such as "MyFirstSketch". Click OK

You should see a new arduino project is created containing an arduino sketch called MyFirstSketch.pde

Add your own arduino code to the void loop() {}

Select an arduino board from the list and click "Build Solution" from the "Project" menu

You should see a successful arduino compile in the "Sketch Build" output window


Method B - Open an existing sketch (automatic mode)

In visual studio select "File>Open" then click "Arduino Project". You will be presented with an "Open File" window which will display your arduino sketch folder. Select a sketch and click OK.

A project will be automatically created for the sketch and the arduino source codes automatically added to the project.

Add your own arduino code to the void loop() {}

Select an arduino board from the drop down list of boards and click "Build" solution from the "Project" menu

You should see a successful arduino compile in the "Sketch Build" output window


Method C - Open an existing sketch (semi automatic mode)

In Visual studio selected "File>Open>File". Navigate to an arduino sketch folder and select a .pde file. Click OK

You will be asked if you would like to Open or Create a project for the arduino sketch. Click OK.

Add your own arduino code to the void loop() {}

Select an arduino board from the drop down list of boards and click "Build" solution from the "Project" menu

You should see a successful arduino compile in the "Sketch Build" output window


Method D - Creation of a new arduino project (manual mode)

In Visual Studio create a new empty C++ project called "MySketch3" in a folder called "MySketch3"

Add a new text file to the project and call it "MySketch3.pde"

Add your own arduino code to the void loop() {}

Select an arduino board from the boards list

Select an arduino board from the drop down list of boards and click "Build" solution from the "Project" menu

You should see a successful arduino compile in the "Sketch Build" output window

Other Pages