VS Arduino
Visual Micro >> Project Guidance >> Create Arduino Library using Visual Micro
https://www.visualmicro.com/forums/YaBB.pl?num=1324932175

Message started by sticks on Dec 26th, 2011 at 8:42pm

Title: Create Arduino Library using Visual Micro
Post by sticks on Dec 26th, 2011 at 8:42pm
Hi,
I'm trying to create my own reusable Arduino Library and I don't see how to do this with VM. A library won't have a .pde file and this is the main VM trigger. I've cobbled something together, but was wondering if I'm just doing something wrong?

thanks.

Title: Re: Create Arduino Library using Visual Micro
Post by Visual Micro on Dec 27th, 2011 at 3:41pm
arduino libs are .h and c/cpp files. you would need to add the lib to your normal arduino libs folder and then restart vs

use project>view all arduino files to see libs that are included in the current sketch.

if in doubt copy the servo library or some other small lib and make sure you can see it in the arduino ide. this will prove you have a correct lib setup for vs

Title: Re: Create Arduino Library using Visual Micro
Post by sixeyes2 on Dec 29th, 2011 at 12:42pm
Trying the same thing here. View all Arduino Files is great but it appears 15 times in the menu!

Arduino project builds correctly so obviously picking up the library for compilation / linking but _libraries is empty.

How do I add the library source files to my solution so I can edit them in VM?

BTW I love the _core\inc and _core\src. It's great to be able to view these files easily.

Iain

Title: Re: Create Arduino Library using Visual Micro
Post by Visual Micro on Dec 29th, 2011 at 6:20pm
to clean up the duplicate items please run the resetaddin documented on the main site. to be certain of the resetaddin working, ensure vs and all envdte.exe processes are closed/shutdown before running the resetaddin.

please copy the #inlcludes from your source into a reply to this topic please. also please confirm where you have the _library located. arduino\libraries or sketch book folder/libraries?. also confirm the name of the library folder(s)

thanks

Title: Re: Create Arduino Library using Visual Micro
Post by sixeyes2 on Dec 30th, 2011 at 3:28pm

Tim@Visual Micro wrote on Dec 29th, 2011 at 6:20pm:
to clean up the duplicate items please run the resetaddin documented on the main site. to be certain of the resetaddin working, ensure vs and all envdte.exe processes are closed/shutdown before running the resetaddin.

Just done this. It's fixed all my issues with the Boards / Serial Port selection. The error I got when starting VS2008 with Arduino v1.0 has also disappeared.


Quote:

please copy the #inlcludes from your source into a reply to this topic please. also please confirm where you have the _library located. arduino\libraries or sketch book folder/libraries?. also confirm the name of the library folder(s)

thanks

By chance I decided to recreate the VS files for my project (before resetting the addin) and now the libraries all appear.

Minor enhancement: Would it be possible to add inc / src filters for each library. I've just added them to my current project but if VM did this automatically...


Iain 

Title: Re: Create Arduino Library using Visual Micro
Post by Visual Micro on Dec 31st, 2011 at 3:27pm
good news.

do you mean split .c/cpp and .h files under each [library Name] tree node?

Title: Re: Create Arduino Library using Visual Micro
Post by sixeyes2 on Dec 31st, 2011 at 10:07pm

Tim@Visual Micro wrote on Dec 31st, 2011 at 3:27pm:

do you mean split .c/cpp and .h files under each [library Name] tree node?

Yes. I was hoping each library could look like _core where the header and source files were in separate folders.
So instead of having a collection of files under each library there would be two filters, inc and src and the appropriate files under each.

BTW despite resetting the addin twice I get two Show All Arduino Files menu items (but not the 15 times I got before the reset). I'm not sure if it's relevant but with no project loaded I get a single greyed out Show All Arduino Files in the project menu. Nothing else is in the menu.

Iain

Title: Re: Create Arduino Library using Visual Micro
Post by Visual Micro on Dec 31st, 2011 at 11:13pm
yes you should not see the grayed out item(s)

i have a look at the show all files

Title: Re: Create Arduino Library using Visual Micro
Post by sixeyes2 on Jan 1st, 2012 at 12:48am
Perhaps this is another limitation with VS2008?

Iain

Title: Re: Create Arduino Library using Visual Micro
Post by Visual Micro on Jan 1st, 2012 at 1:35am
i've done more 2010 testing than 2008. hopefully it's easy to fix

Title: Re: Create Arduino Library using Visual Micro
Post by sixeyes2 on Jan 12th, 2012 at 8:42pm

sixeyes2 wrote on Dec 31st, 2011 at 10:07pm:

BTW despite resetting the addin twice I get two Show All Arduino Files menu items (but not the 15 times I got before the reset). I'm not sure if it's relevant but with no project loaded I get a single greyed out Show All Arduino Files in the project menu. Nothing else is in the menu.

I've just installed VS2008 on my older laptop (it has XP SP3) and I'm only seeing one instance of Show All Arduino Files. When no solution is loaded the Project menu is empty. On my newer laptop (Win7 SP1) I see Show All Arduino Files when no solution is loaded and twice once a solution is loaded. I'm not sure whether the OS is important. But it does indicate that you can get both behaviours with VS2008.

Iain

Title: Re: Create Arduino Library using Visual Micro
Post by Visual Micro on Jan 13th, 2012 at 9:24pm
thanks for the info. I'll try and add some trace messages for that menu item which might help us see the difference.

can you confirm that all other menu items and tool bar controls are okay? please also check right clicks (in solution explorer) on solution and project. look okay? got some arduino options?

Title: Re: Create Arduino Library using Visual Micro
Post by sixeyes2 on Jan 14th, 2012 at 1:23am

Tim@Visual Micro wrote on Jan 13th, 2012 at 9:24pm:
thanks for the info. I'll try and add some trace messages for that menu item which might help us see the difference.

can you confirm that all other menu items and tool bar controls are okay? please also check right clicks (in solution explorer) on solution and project. look okay? got some arduino options?


Which VS2008 are you asking about? I'm currently working on the old laptop which appears to be functioning correctly (current number of menu items in project menu). Just right clicked on Solution and an Arduino menu is listed. However couldn't see any Arduino menus when right clicking on the project, what should I see. All Tools/Arduino menu items appear to be correct.

Until this week all my previous experience of VM had been on the other laptop.

Iain

Title: Re: Create Arduino Library using Visual Micro
Post by Visual Micro on Jan 29th, 2012 at 10:35pm
this was sorted wasn't it?

Title: Re: Create Arduino Library using Visual Micro
Post by sixeyes2 on Jan 30th, 2012 at 1:30am

Tim@Visual Micro wrote on Jan 29th, 2012 at 10:35pm:
this was sorted wasn't it?


No. Win 7 laptop is still showing 2 instances of the Show All Arduino Files using V26 from Codeplex (but reported as 25 in tools/options).

Perhaps there's an issue with this install of VS2008 because tool window docking doesn't work either. Planning a reinstall of VS when I get time.

Iain

Title: Re: Create Arduino Library using Visual Micro
Post by Visual Micro on Jan 31st, 2013 at 5:57pm
Off-Topic replies have been moved to this Topic.

VS Arduino » Powered by YaBB 2.6.12!
YaBB Forum Software © 2000-2024. All Rights Reserved.