Opening Arduino Sketches and Projects

Existing Sketches

If you already have sketches created in the classic Arduino IDE, then you can create Visual Studio/Atmel Studio projects from them and continue to work in Visual Studio/Atmel Studio.

  •  Click on File > Open > Arduino Project (with .INO or .PDE file extension).

- or -

  • Click on File > Open > File
  • Select an .INO or .PDE file from an existing sketch in your Arduino project directory
    Visual Micro will ask if you want to create a new project. If you answer "Yes", then Visual Micro will create a Visual Studio/Atmel Studio project from the .INO, .PDE and .CPP files in this folder.

Warning 16 Note:

Visual Micro as well as the original Arduino IDE require that the main .ino file and the disk folder containing this file have the same name.
The main .ino file is the one that contains the setup() and loop() functions.


Your screen should look like this:
Opened Existing Project


Now you can start editing your code.

Note IconNote:

Since Visual Micro uses the build tools that came with your original IDE (like the Arduino IDE), opening an existing project won't change anything to your source files.

If you ever decide to go back to the Original Arduino IDE: No problem, Visual Micro projects are backward compatible, so you can open such projects in the original IDE at any time. However, if you use some advanced features of Visual Micro, then your project cannot be used anymore in the Arduino IDE.
This instruction shows the easy steps that are needed to make such a advanced project compatible with the Arduino IDE again.


Continue by Setting up your board model and connection.

 

Existing Projects/Solutions

Normally, the best way to open Arduino projects in Visual Studio is to use standard Visual Studio commands such as 'File>Recent'.

This applies after the project has been created for the first time using Visual Micro commands such as "File>Open>Arduino Project", "File>New>Arduino Project".

IE: You must have a Solution (.sln) to be able to open a Solution. Normally Arduino just has .ino/cpp etc. which is why Visual Micro commands auto create and configure solutions for you, but this only needs to happen once per project.


When opening projects make sure you open the Solution (.sln not .ino file) when you re-open projects. Opening an existing Solution will retain your previous "window layout" and "selected configuration" etc.

When your Solution is on the Recent menu you will have no need to use "File>Open Arduino" project, which is normally just used the first time you open an existing Arduino project in VS.


If you do not see your "Solution" on the "File>Recent" menu, then click the Solution to activate it in the explorer, then click "File>Save As". Saving the Solution (even with same name) will force it onto the Visual Studio "Recent" menus.