Getting Started with Visual Studio and Arduino

Step 1: Install Visual Micro

Step 2: Open an existing Arduino sketch as follows:

  • Click on File->Open->Arduino Project
  • Select an existing sketch in the Arduino project directory.
  • Once the project has loaded and opened, select a board from the Boards toolbar.
  • Select a programmer from vMicro->Uploader->Hardware Programmer.
  • Press the Blue tool bar arrow or SHIFT+F5 for compile and upload (Debug>Start without debugging)
  • Press the Green tool bar arrow or F5 to compile, upload and debug

OR

Step 2: Start a new Arduino project

  • Click File->New->Arduino Project
  • Enter a name for your project
  • Click OK and enjoy.

Step 3: Compile and upload to an Arduino

  • The standard Visual Studio "Build" options will build/compile for Arduino for either a single Arduino project or all Arduino projects in the current current solution.
  • The standard Visual Studio "Debug" options will upload (but not debug). "Start with or without" debugging will upload for the selected port and board.
  • On the tools menu you can also override the serial upload and use a programmer instead.
  • To recap, all of the Visual Studio "build/debug" tool bar buttons, "build" menu items, "debug" menu items, right click context project menu and keyboard shortcuts provide compile and upload for Arduino.
  • For an example then press F5.
  • If you have multiple arduino projects in a single solution you can right mouse menu on a project name to "Set As Startup Project". This governs which project is uploaded when clicking F5 or any of the standard "Start" commands in Visual Studio. The current start up project will be shown in bold in the Visual Studio solution explorer.

Some more information

Visual Studio Start Up - Tip

When Visual Studio starts the plugin loads a list of boards and libraries which are then displayed on the various menus. During the load, the addin displays the names of these arduino items in the Visual Studio status bar. 

This process is a background process, which means that you do not have to wait for the process to complete before you start programming an Arduino project in Visual Studio. The apparent slowness of adding user interface items is due to the way Visual Studio works. 

We are investigating alternative places to add library and boards lists which will also enable arduino examples to be included.

Multiple Arduino projects in one solution

  • Click File->New->Arduino Project
  • Enter a project name
  • Click Ok and a new project/sketch is added

Arduino serial monitor

More that one Serial Monitor can be view at one time. Simply select the port from the toolbar drop down menu, click on the Serial Monitor icon next to the toolbar. Now place the Monitor window where you want. Repeat this action for more Serial Monitor windows.

Arduino boards

Each project is setup with a unique board. Select the board of choice from the toolbar and save that project.