Arduino libraries

Hello, I am having trouble with my Arduino. I am trying to add a library. but every time I try to add a library it won't compile. I am trying to add a simple timer library. Can anyone give me instructions on how to add a library into my arduino?

Thanks
Student238

You just unzip the library into the libraries folder inside the Arduino software.

If the library isn't working, it may be that it is not for the same version of the IDE as you are using. Check the sticky thread at the top of the Programming Questions forum.

majenko:
You just unzip the library into the libraries folder inside the Arduino software.

Inside your sketchbook folder, not the Arduino software folder.

majenko:
You just unzip the library into the libraries folder inside the Arduino software.

No, that is not the proper place for Contributed libraries. They should go inside the "libraries" folder of the sketchbook directory.

"If you're using one of these [Contributed] libraries, you need to install it first. To do so, download the library and unzip it. It should be in a folder of its own, and will typically contain at least two files, one with a .h suffix and one with a .cpp suffix. Open your Arduino sketchbook folder. If there is already a folder there called libraries, place the library folder in there. If not, create a folder called libraries in the sketchbook folder, and drop the library folder in there. Then re-start the Arduino programming environment, and you should see your new library in the Sketch > Import Library menu"

They should go inside the "libraries" folder of the sketchbook directory.

Ah, so the sketchbook folder actually has a use then? I have failed to find a valid use for it so far, so I never bother using it.

Not very helpful for a new user that probably is using it to store their sketches. The reason for using the sketchbook folder is that it is a constant location that doesn't change across different IDE versions. If you store your libraries in the software folder, and download a new IDE, then the downloaded libraries would need to be copied to the new software folder.

The whole "sketchbook" thing is flawed and should be scrapped IMPO.

  1. If you have more than a handful of sketches in there (why the frog are they called sketches anyway?!) the sketchbook menu entry becomes pointless.
  2. The IDE doesn't default to saving in there.
  3. It's bad practice saving all your software in one location. The software should go with the other items from the project - schematics, documents, etc.
  4. Libraries in sketchbook is stupid - that's like storing MS Office plugins in My Documents.

Replace the whole sketchbook system with a "normal" save dialog, and replace the sketchbook menu entry with a "Recent" menu entry - it would be far far more usable.

(In case you hadn't noticed, I really really hate the Arduino IDE with a passion. But then, if it's all you've ever used, you can't be expected to know better.)

I wouldn't know. It's far from the only IDE I've used. I started programming professionally in COBOL, batch compiling and writing Rexx scripts to automate. Since then I've used VB up to version 6, Delphi up to version 7, VC# in various versions, Eclipse, Real Basic, XCode, Sun Developer tools, Oracle Developer, and probably others. I don't whine about the tools, I just get on with the job.

Ah... COBOL... I remember those days... Probably the third or fourth programming language I used. Started with BASIC, and Assembly, way back on VAX/VMS machines, then moved to C, and had COBOL inflicted on me... urgh...

majenko:
(In case you hadn't noticed, I really really hate the Arduino IDE with a passion. But then, if it's all you've ever used, you can't be expected to know better.)

Please, let's not get in the habit of hijacking threads from new users asking questions with rants about the Arduino project.

If there is something you think needs feedback, it is best to post a new thread in the appropriate part of the Forum (e.g. Suggestions for the Arduino Project - http://arduino.cc/forum/index.php/board,21.0.html) and link back the initiating thread as an example.

VAX/VMS was FORTRAN for me, but that was before I got paid to do it. Assembler was done on Rockwell Aim65s. BASIC on PETs and BBCs mostly.

James, I fully agree with you. Lets just help people to use the tools provided.