Arduino Libraries
Nov 19, 2009 The download package for Arduino 16 has all the necessary goodies included in the zip file. The current download package for Arduino 17 is a dmg file instead of a zip file, and includes the application and drivers only, no libraries directory etc. I resorted to installing v16 since I couldn't figure out how to install libraries in v17. The base Arduino source files are in the Arduino installation, under hardware/./cores/. Source for additional libraries included are in libraries/. Additional files may be found in the sketchbook under its hardware/./cores/ and libraries/ directories. The built-in libraries and some of these additional libraries are listed in the reference. To use the additional libraries, you will need to install them. How to Install a Library Using the Library Manager. To install a new library into your Arduino IDE you can use the Library Manager (available from IDE version 1.6.2).
Libraries are files written in C or C++ (.c, .cpp) which provide your sketches with extra functionality (e.g. the ability to control an LED matrix, or read an encoder, etc.). They were introduced in Arduino 0004.

To use an existing library in a sketch simply go to the Sketch menu, choose 'Import Library', and pick from the libraries available. This will insert an #include statement at the top of the sketch for each header (.h) file in the library's folder. These statements make the public functions and constants defined by the library available to your sketch. They also signal the Arduino environment to link that library's code with your sketch when it is compiled or uploaded.
User-created libraries as of version 0017 go in a subdirectory of your default sketch directory. For example, on OSX, the new directory would be ~/Documents/Arduino/libraries/. On Windows, it would be My DocumentsArduinolibraries. To add your own library, create a new directory in the libraries directory with the name of your library. The folder should contain a C or C++ file with your code and a header file with your function and variable declarations. It will then appear in the Sketch | Import Library menu in the Arduino IDE.
Note: for users of versions previous to 0017, libraries belong in a subdirectory of the Arduino application directory: ARDUINO/lib/targets/libraries. For version 0017, the libraries directory was moved to make them more convenient to install and use.
Where Are Arduino Libraries Stored Machine
Because libraries are uploaded to the board with your sketch, they increase the amount of space used by the ATmega8 on the board. See the FAQ for an explanation of various memory limitations and tips on reducing program size. If a sketch no longer needs a library, simply delete its #include statements from the top of your code. This will stop the Arduino IDE from linking the library with your sketch and decrease the amount of space used on the Arduino board.
Arduino Libraries Download
To get started writing libraries, download this test library. It should provide a basic template for creating a new library. After you've made changes to your library, in order to get it to recompile, you will have to delete the .o file generated in the library's directory.