Creating Libraries under MacOSX

I'm a newbie to the Arduino but by no means a newbie programmer so any help (gratefully accepted, thank you) can be succinct.

I am trying to explore library writing to the Arduino (ATMEGA328) Using v017 of the IDE software. I can't seem to figure out the folder hierarchy. I have read the tutorial but on the Mac it doesn't seem to be following the same rules. I can't seem to trigger the auto-generation of the library described in the tutorial.

I have two separate trees: Application directory: Arduino/ which only contains the Arduino.app bundle Development directory: ArdProgs/ which holds the sketches folders

I have tried creating the ./hardware/libraries/ hierarchy in either directory and my 'example' sketch can't find the header file nor is the object (.o) file generated.

I did discover that I can put the library file into the application bundle. There is a ./hardware/libraries/ folder in there but that seems a bit odd to have to modify the application bundle with any additional libraries.

I have checked the preferences file for some indication of how to set the library hierarchy and can't seem to see any obvious settings.

I would appreciate any help from anyone who has gotten this to work on a Mac system (10.6) successfully. If you have you might also comment on the best practice for debugging the library (can the library include other libraries like the Serial library for sending some feedback?)

Thanks in advance.

I think I have answered my own question. Evidently something changed from older versions (upon which the documentation is based) and v17.

I found this little detail from the version change file:

  • Support for third-party libraries in the SKETCHBOOK/libraries folder.
  • Libraries are now compiled with the sketch, eliminating the delay when
    switching boards and the need to delete .o files when changing library
    source code.

Which implies that the new directory hierarchy is ./libraries/ not ./hardware/libraries/ and that permanent object files are no longer maintained but generated on the fly.

When I tried this change, it worked; external libraries now appear in the “Import Library” menu.

There is some info here as well: http://arduino.cc/blog/?p=313.

Thanks. This explains alot.