Custom Library directory?

Hi,

I have written (simple) and modified a number of libraries. Is there a way to keep these changed libraries out side of the arduino-XXXX/libraries directory? It would make moving form one version to another a lot easier.

I wanted to have a directory “MyLibraries” in which I would put custom libraries. I thought I could then link MyLibraries to the arduino-XXXX/libraries/MyLibraries Then in sketches I thought I could #include <MyLibraries/customLibraries.h> but it seems that is not allowed. Is there a way to do this? So I don’t have to copy all custom libraries every time I switch to a different version of Arduino? I want just one copy of my custom libraries to work across different versions of Arduino.

any help is appreciated
Tim

Well looking at it a bit more I did find that I can have the directory MyLibraries with my custom libraries in that directory. Then instead of linking the MyLibraries to a directory in arduino-XXXX/libraries/ I can link the individual directories in MyLibraries to the arduino-XXXX/libraries directory. That means that I have to make a bunch of links instead of just one, but it works. This way no change is needed to the #include line.

I would still like to know if there is away to just link one directory with all the changes I made, instead of linking each individual directory.

Tim. Ps. I am using Fedora 13, Arduino 21 (mainly)

Why not put your stuff in the ‘libraries’ directory in your sketchbook directory?
Works for me with Fedora 11 and Arduino 21.

[1009] -=> ls -1  sketchbook/libraries/
DallasTemperature
HC4LED
InternalTemp
LedControl
MsTimer2
NewSoftSerial
OneWire
RGBStrip
TinyGPS
Tlc5940
WiShield
glcd
ks0108

These are all libraries that I’ve pulled of the playground and/or the authors’ websites.

-Rusty-

Do I have to name that directory sketchbook/ ? In Preferences it lists /home/Tim/Projects as my Sketchbook dir. That is where I had the MyLibraries dir, I changed its name to libraries and removed the links from arduino-XXXX/libraries . But the compiler can not find the library. What does your include line look like?

Tim

Do I have to name that directory sketchbook/ ?
In Preferences it lists /home/Tim/Projects as my Sketchbook dir.

No, not if you’ve already set your preferences for your sketchbook directory
to something else.

That is where I had the MyLibraries dir, I changed its name to libraries and removed the links from arduino-XXXX/libraries . But the compiler can not find the library. What does your include line look like?

If you changed the direrctory names while the Arduino IDE was running then you will
need to restart the IDE.

I renamed my sketchbook directory to ‘Projects’ and put that into my preferences for
my sketchbook directory. I started the IDE and compiled a project that used one of
my libraries and everything ran just like clockwork.

My #include line would be something like
#include <WiShield.h>
no library/WiShield.h is needed.

Your customlibraries.h file should be in
/home/Tim/Projects/libraries/customlibraries/customlibraries.h

If you’ve got everything where the IDE expects it then pulling down
the menu Sketch->Import Library should show your customlibraries.
It would probably be best to put each libraries into its own directory
instead of all into one.

Thank you Rusty in Texas

I thought I had tried that. But thought I should try it again. This time it works!

So Thanks For Your Help Tim