Pages: [1]   Go Down
Author Topic: Mode to create libraries?  (Read 1049 times)
0 Members and 1 Guest are viewing this topic.
Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 39
Posts: 5557
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I was starting on my first library last night, and I quickly found that the IDE won't allow you to use your own extensions (ie, .cpp and .h for a library) - an integrated way to create a library would be really nice, along with boilerplate templates for the header and source files, and a way to "one-click" package everything (maybe include a means to edit/create the keywords.txt file, too).

Right now, I created my library as two separate tabs (called source and header), then once done, I used gedit (in Ubuntu) to bring up the parts, rename them, stuff them into a directory, etc - there wasn't any problem doing this for my skills, but an integrated method in the IDE would've been nicer...

I just want everything, don't I? Maybe I need to move to eclipse...

 smiley
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 11
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You should be able to add .cpp and .h files to a sketch (as long as you also have a .pde file).  But you're right, there it could definitely be easier to make and package libraries.
Logged

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 39
Posts: 5557
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hmm - well in the project I was trying I didn't have an initial .pde file, I just started coding up the library; tonight when I get home and work on the project again (I am fighting issues with incorporating the SoftwareSerial library usage into the library - but I think I found an example of how to do it properly here in the forums), I will give that a shot; I need a regular sketch anyhow in the package to act as an example of usage anyhow. Thanks for the tip.

 smiley
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

0
Offline Offline
Sr. Member
****
Karma: 4
Posts: 329
KC4MM
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I wrote and use libraries extensively. My current project has nine that I wrote. When I write them I almost always start with a simple .pde sketch to debug and test them.
Logged

Sweden
Offline Offline
Jr. Member
**
Karma: 0
Posts: 74
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The system isnt very good at the startup of a library, no. Keywords dont update without restarting and so on.
BUT when the keywords run, its fairly easy to edit the .h and the .cpp when running the sketch to kill bugs.
Personnaly I use Notepad++ as my texteditor, so its just a alt-tab away.
I also miss a better possibility to document the functions I create in the library, but most Arduino coders seems to disagree.
A nice function in the sketch would be a intellisense, when using functions. Even if its mr Mean:s "invention".  smiley-wink
Logged

Pages: [1]   Go Up
Jump to: