Pages: [1]   Go Down
Author Topic: Arduino libraries  (Read 844 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

UK
Offline Offline
Faraday Member
**
Karma: 100
Posts: 4153
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Get 10% off all 4D Systems TFT screens this month: use discount code MAJENKO10

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Inside your sketchbook folder, not the Arduino software folder.
Logged

Fort Lauderdale, FL
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6144
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

http://arduino.cc/it/Reference/Libraries
"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"
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.c

UK
Offline Offline
Faraday Member
**
Karma: 100
Posts: 4153
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.
Logged

Get 10% off all 4D Systems TFT screens this month: use discount code MAJENKO10

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: June 15, 2012, 01:57:33 pm by dxw00d » Logged

UK
Offline Offline
Faraday Member
**
Karma: 100
Posts: 4153
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.)
Logged

Get 10% off all 4D Systems TFT screens this month: use discount code MAJENKO10

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

UK
Offline Offline
Faraday Member
**
Karma: 100
Posts: 4153
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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...
Logged

Get 10% off all 4D Systems TFT screens this month: use discount code MAJENKO10

Fort Lauderdale, FL
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6144
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

(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.  
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.c

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: June 15, 2012, 02:19:25 pm by dxw00d » Logged

Pages: [1]   Go Up
Jump to: