Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) Add "Examples" menu? (Read 7815 times)
Lakes
Junior Member
**
Offline


Posts: 19
Joined: Oct 26th, 2012
Add "Examples" menu?
Oct 30th, 2012 at 11:05am
Print Post  
Is it possible to add an Examples menu like in the original Arduino IDE?
  
Back to top
 
IP Logged
 
Marius
Developer
****
Offline


Posts: 204
Location: Centurion RSA
Joined: Sep 7th, 2011
Re: Add "Examples" menu?
Reply #1 - Oct 30th, 2012 at 1:15pm
Print Post  
Use the Micro Explorer, it has an Examples section already.
It is the Yellow question mark next to the board selector
  
Back to top
IP Logged
 
Lakes
Junior Member
**
Offline


Posts: 19
Joined: Oct 26th, 2012
Re: Add "Examples" menu?
Reply #2 - Oct 30th, 2012 at 3:11pm
Print Post  
Thanks, nice to have everything in one place.

Now I have another problem, when I open an example it adds it to the existing solution, which is not what I want.

I want to look/modify/test an example as a new solution, so I have to close the current solution or open another instance of the IDE?

Another folder seems to ave been created called My Examples with the examples I opened in Visual Studio. 

I got myself pretty confused between closing tabs and opening examples!

Thanks for your help.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Add "Examples" menu?
Reply #3 - Oct 30th, 2012 at 3:24pm
Print Post  
It's okay to let it create the example in the same solution now that you understand how it works. You can always collapse them in the solution explorer or right click remove them.

However you might not need to. You can drill further down into the examples tree view and click on an .ino source code file. This will just open the source code and not create a project or solution.

Another option is, when you click the example name, you are asked asked if you want to create a new project or not. If you say no then the actual example is opened instead of creating a copy in "My Examples"

So to re-cap, these are the 3 ways of working with examples. It is up to you if you want them in another ide or in the same ide. In another ide you just open another copy of visual studio.
« Last Edit: Oct 30th, 2012 at 3:25pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Add "Examples" menu?
Reply #4 - Oct 30th, 2012 at 4:13pm
Print Post  
One other point. If you have multiple projects in a single solution then notice that only one of the projects is displayed with its name in bold.

The bold one is the "Startup" project, it is the one that will be uploaded to the arduino when you press F5

To set a project as the "Start-up" project, right click the project name in the solution explorer and click "Set as StartUp Project".
  
Back to top
WWW  
IP Logged
 
Lakes
Junior Member
**
Offline


Posts: 19
Joined: Oct 26th, 2012
Re: Add "Examples" menu?
Reply #5 - Oct 30th, 2012 at 4:21pm
Print Post  
I`m still really confused by this, here we have two examples open but only one is shown in the Solution Explorer??



Just to be clear, each tab is/should be part of the same solution as shown in the Solution Explorer and is/should be added together when compiled? 

What happens when you have two tabs open that both have setup/loops in? Ah ok, I see... Smiley
« Last Edit: Oct 30th, 2012 at 4:23pm by Lakes »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Add "Examples" menu?
Reply #6 - Oct 30th, 2012 at 4:39pm
Print Post  
In vs you can open any file you like, the file doesn't become a part of a project it's just for reference. 

You can click the X to close the file when you have finished with it.

When you compile an arduino project the plugin looks at the actual files in the project/sketch folder to determine what needs to be compiled. Therefore, whatever additional files you have in visual studio (that are not part of the sketch) will be safely ignored.

It might seem a bit of a new concept to you but it will feel right once you have used it for a while. 

So you have one project open and one additional file. 

When you click into the additional file to edit it you will notice that nothing is selected in the solution explorer. 
When you click a valid project file to edit you will notice that it also becomes selected (below the project) in the solution explorer.  So this clearly shows  what are project files and what are additional files.
  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Add "Examples" menu?
Reply #7 - Oct 30th, 2012 at 4:42pm
Print Post  
By the way on the little toolbar above the solution explorer is a button that switches the view to exclude the pch/visual micro and other files/folders that you will not expect to normally see below your project.

The view setting (All Files) that you currently have selected is confusing for new users.
  
Back to top
WWW  
IP Logged
 
Lakes
Junior Member
**
Offline


Posts: 19
Joined: Oct 26th, 2012
Re: Add "Examples" menu?
Reply #8 - Oct 30th, 2012 at 5:17pm
Print Post  
Got it now.

Thanks!
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Add "Examples" menu?
Reply #9 - Oct 30th, 2012 at 6:55pm
Print Post  
Great. I forgot to say that if you do ever just want one example and one project at a time...

Click "File>Close Solution" before opening an example

The following info might be useful when working with multiple open projects at the same time. If you always work with the same board and port then  ignore the rest of this post

The Arduino board and serial port are retained per project. This means that you set the board and port individually for each project. 

The last used settings are automatically applied/adopted to new projects so normally you don't need to set the board and port.

The board and port options on the tool bar and menus effect the "active" project. The active project is based on which project or file is currently active in the solution explorer. 

If the solution node is selected in the solution explorer then there will not be an active project. In this case,  the board and port settings apply to the StartUp project.

The "Build" menu is useful to learn which project vs believes is active.
« Last Edit: Oct 30th, 2012 at 6:57pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint