This document explains how to add templates to the built in Atmel Studio "File>New Project" wizard. This allows new projects to be created that automatically include commonly used code.
Any number of sources files can be included in a new project template.
The wizard shows a list of templates which can be extended by adding templates to various folders.
The best place for your own templates is probably "[mydocuments]\Atmel Studio\Templates\Project Templates"
A project template is a zip file containing a few files. A project, sources, mytemplate.vstemplate, an icon and other optional files.
The project, sources and mytemplate files are all text files that can be edited with a text editor such as notepad++
This example BlankSketch.zip can be placed in the "project templates" folder as an example. Alternatively you can edit the code within the BlankSketch.ino adding your own default Arduino code.
To create your own template
- Extract the BlankSketch.zip to a temp folder
- Then rename the BlankSketch files to a prefered name such as TestSketch
- Edit the mytemplate replacing all occurances of the text BlankSketch with TestSketch, do the same for the .cppproj file
- Add whatever code you want to TestSketch.ino and zip the files into
- TestSketch.zip which should be placed in "mydocuments/atmel studio/templates/project templates"
tip: New project properties (such as tool chain, avr, sam etc) within the .cppproj file will be ignored. If the sketch name, folder name and project name match then Visual Micro will manage these properties automatically when required. Basically, you just have to ensure the file and project names as as you require them to be (see bullet points above)
To avoid compilation problems ensure that source files and the new project names are valid Arduino names. Less than 30 chars, alphanumeric only, no spaces.
Organising Arduino New Project Templates
The template zip files can be placed in sub folders that are created below the templates folder. This example was created by adding the BlankSketch.zip to a folder called "mydocuments\atmel studio\templates\project templates\My Arduino Projects" folder.
Atmel Studio does not need to be re-started when templates are added or modified. Close and re-open the File>New>Project Wizard to view changes instanstlynb: