How to test a new installation of Arduino Visual Studio

by Visual Micro 4. October 2011 09:29

Arduino for Visual Studio is designed for users who already understand how to use the Arduino IDE. 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

  • Install the arduino software from arduino.cc
  • Run arduino once
  • Install this software
  • Depending on your security settings you might need to run Visual Studio as Administrator to either install or reset the arduino addin
  • Open Visual Studio and set the location of the arduino.exe in "Tools>Options>Visual Micro>Arduino>Arduino Application"
  • Register .pde (and .ino) files for color coding by following this article

 
The following are a few ways to test your Arduino for Visual Studio installation
 
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



Tip: The same functionality is available from the Visual Studio "Standard" tool bar and also the "Solution Explorer" context menu



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


This product is not "associated to" or "endorsed by" Arduino. The design of the sketch compiler and uploader is directly based on the arduino source code

Tips & Bits

Debug and power tools coming soon!!

Visual Assist X (VAX) - How to configure Arduino sketches as VAX C++ files. Refactor, Snipets, enhanced syntax colors, examples, suggestions and much much more. Only downside is that it costs $100.

Connect two or more arduinos and spy on the serial communication using visual studio and "Serial Echo"

Apple Mac users might find this xcode site useful

Coming soon! Android and Processing for Visual Studio

How to prevent or remove Visual Studio pch folders

How to configure visual studio color coding for arduino source code

See more Examples

Multiple sketch projects and windows projects can co-exist in a single solution. Fully integrated. F5 Compile and upload (startup project). Build Project, Build Solution