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
Normal Topic Library design (Read 4077 times)
Hawk_08
Newbies
*
Offline


Posts: 8
Location: Québec, Canada
Joined: Aug 25th, 2013
Library design
Sep 10th, 2013 at 3:52pm
Print Post  
Hello everyone,

I have read some forum posts on the subject, but did not find the answer I was looking. To build a new library do I simply need to create a folder in libraries under my arduino installation and add my .h and .cpp files?

Beside manually creating all the files and folders is there a way to automatically create a library under visual micro?

Thank you
M.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Library design
Reply #1 - Sep 10th, 2013 at 3:56pm
Print Post  
Hi there,

That will work but Arduino supports custom libraries in "libraries" folder below your sketchbook folder. This is the best place to put your library and will not be affected by upgrading your Arduino ide.

The sketchbook folder is normally mydocuments/arduino but you can override it if required. I suggest you leave it as default.

After you have your library click "Tools>Visual Micro>Reload Toolchains" or restart the ide.

Notice, when a project is open, on the "Project>Add Sketch Library" menu item there are two entries User and Core. Your Sketchbook library will appear on the "User" menu.

Does this help?
  
Back to top
IP Logged
 
Hawk_08
Newbies
*
Offline


Posts: 8
Location: Québec, Canada
Joined: Aug 25th, 2013
Re: Library design
Reply #2 - Sep 10th, 2013 at 4:01pm
Print Post  
Yes,

But I still need to create to create my .h and my .cpp files right?

I will still try what you just told me. 

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


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Library design
Reply #3 - Sep 10th, 2013 at 4:13pm
Print Post  
Yes you need the .h and cpp files. I haven't played much with the best workflow to achieve this but I think there are a few combinations to try.

If you are using Visual Studio, after creating the library and adding some files, click "Tools>reload Tools chains" then click "project>show all arduino files" to see and edit the library code along with a test sketch project.

In Atmel Studio it might be best to initially create a sketch in the library folder. Add your cpp and .h files then remove the sketch and the Visual Micro folder when you have finished editing the library.

I need to play with it some more.

Another option is to use a standard Atmel project to create the library. If you add new files then use "tools>visual micro>reload toolchains" to quickly test and use the lib changes in a sketch project.
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Library design
Reply #4 - Nov 28th, 2013 at 1:04pm
Print Post  
Off-Topic replies have been moved to this Topic.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint