Quick Start Guide to Arduino Programing in Visual Studio

by Visual Micro 11. April 2010 10:54

 

After installing the .dll and resource files, you must configure your Visual Micro options:

 

Visual Studio | Tools | Options | Visual Micro

 

The most important option to set is the Arduino Application under [Locations]. Select the path to your Arduino executable (arduino.exe).

 

 

I suggest copying the latest Arduino (0018) to a folder called C:\Arduino\ArduinoIDE. By using a common Arduino folder you will find it easier to update to the latest Arduino versions in the future without having to reset your Visual Micro options.

 

After entering a valid Arduino folder, click the Arduino Library and the GCC Application (WinAVR) folder paths. They should automatically determine their locations.

 

 

 

 

 

After setting the Visual Micro properties, click [OK] to close the Options window. After a short pause (< 2 sec), the Visual Micro toolbar should appear containing the Boards and Serial ports menu.

 

 

Select your Arduino board and the serial port it is connected to.

 

Opening an Existing PDE

 

In Visual Studio select File|Open, and navigate to a folder containing an Arduino sketch (.pde). Select the sketch and click [OK]. The sketch will open briefly and then the following will happen automatically: the sketch will close, and it will be re-opened in a Project & Solution with the same name as the .pde; the Project & Solution will be created automatically in the sketch's folder.

 

Adding Libraries

 

You can add libraries using the Libraries menu on the toolbar, or add files to your projects as you normally would. When you add .c or .cpp files you will find that they automatically associate themselves to a custom build action of AVR_C_GCC or AVR_CPP_GCC (right-click with your mouse a source file to see what I mean).

 

If you encounter any problems just re-associate source files to the correct custom build tool. If you have an older Visual Studio project and want the toolbar to work with it then just edit the Visual Micro .vcproj and .sln files with Notepad, and copy over the platform and build settings.

 

NOTE that Visual Micro only compiles correctly when the build type is set to AVR|Win32. This is designed to ensure that Visual Micro doesn't mess with your normal Visual Studio projects.

 

Click compile and enjoy!

 

How to build an avr-gcc program using visual studio

by Visual Micro 11. April 2010 00:06

The initial release of the visual micro addin for visual studio is designed for arduino however it should be possible to use the system to program normal avr devices using visual studio. This is entirely untested but at the very leat this software will provide all the information and tools you need to adapt an avr solution.

Ignoring the arduino boards and library system you will find everything you need to adapt your own Visual Studio avr solution. AVR Intellisense, compliation, upload and much more

Arduino Visual Studio Overview

by Visual Micro 10. April 2010 22:21

Beta released 11th April 2010. Free version for private or student use is due for release end April 2010

Intellisense for the arduino is provided by Visual Studio. The 'Visual Micro' add-in simply helps to ensure that the files of a .pde project, the arduino core and arduino libraries are registered (or known) to the Visual Studio intellisense system.

Add-in preferences are set using the "Visual Studio Tools Options" window. When set the add-in will extend the Visual Studio menus and toolbars with additional controls to help you build arduino projects. (Note: all visual studio extensions created by the add-in are temporary)

The add-in is also able to retain board and port settings for each sketch (project). In most cases this means you will select a board and serial port once for the life of each project. That you can work on multiple projects at the same time, each project with its own board and port settings.

The add-in provides many other useful features.
Here are just a few...

> Automatic create new project from sketch

> Automatic link of all project items to intellisense

> Two way sketch compatibility with Arduino IDE

> Option to open the Arduino IDE loading the active visual micro studio project sketch.

> Automatic code completion (Visual Studio Style!)

> One click include of an Arduino Library

> Automatic LINK to arduino cores and libraries.

> When the arduino cores are updated your projects will automatically update (on next use)

> Standard copy/paste, highlight short cut keys

> All short cut keys user-definable

> Multi-instance Serial monitor enabling, for example, the output from two xbees to be monitored easily with auto port close if using the upload tools (see warning notes below about this!)

> Simple one click create of .c;.h with #include added to active .pde;.c or .cpp window.

> Code example helper makes it easy to create your own code examples for your projects.

> Examples/snippets are stored in an xml file in the same location of the code file.

 

 


Whilst not supported by Arduino or ourselves, the add-in allows you to switch on, at your own risk, "Compile and Upload" features. We have tried to ensure that these features are correct for Arduino and have been using our own boards without problem. We have found the Compile and Upload so useful we decided to leave it in the product (at your own risk!).

 

News - 2010

2nd May - Visual Studio 2010 - Navigating the Navigator with ArduPilot

18th April - Supports multiple sketch (pde) files in a single project (ArduPilot)

17th April - Supported on all windows language versions

14th April - First test success

11th April - The arduino visual studio beta was released today

Links and References

Visual Micro Forums here

Visit the Arduino forums here

A different solution here

Bob Powell's solution here

Ardupliot example here