adafruit-all-about-arduino-libraries-install-use.pdf

(969 KB) Pobierz
All About Arduino Libraries
Created by Bill Earl
Guide Contents
Guide Contents
Arduino Libraries
Standard Libraries
User Installed Libraries
2
4
4
4
Where to Install your Libraries
Locate your Sketchbook Folder and the Libraries Folder Inside
Open the Preferences Dialog
Find the Sketchbook Location
Create a Libraries Folder
Rename to "Libraries"
6
6
7
7
7
8
Installing a Library on Windows
Close the Arduino IDE
Download the Zip File
Open the Zip File
Paste into your Libraries Folder
Give it a Legal Name
Re-start the IDE
Verify that it Compiles
9
9
9
9
10
10
10
11
Installing a Library on Mac OSX
Close the Arduino IDE
Download the Zip File
Find it in the Downloads Folder
Drag it to your Libraries Folder
Give it a Legal Name
Re-start the IDE
Verify that it Compiles
12
12
12
12
13
13
13
14
Installing a Library on Linux
Close the Arduino IDE
Download the Zip File
Save the Zip File
Open the Zip File
© Adafruit Industries http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use
15
15
15
15
16
Page 2 of 20
Start the Extraction
Extract into your Libraries Folder
Give it a Legal Name
Re-start the IDE
Verify that it Compiles
16
16
17
17
17
Common Library Problems
'xxxx' does not name a type
Wrong Folder Location
Don't have a "Sketchbook" folder
Incomplete Library
Wrong Folder Name
Wrong Library Name
Multiple Versions
Library Dependencies
“Core” Libraries
Forget to shutdown the IDE
19
19
19
19
19
20
20
20
20
20
20
© Adafruit Industries http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use
Page 3 of 20
Arduino Libraries
Arduino libraries are a convenient way to share code such as device drivers or commonly used
utility functions. This guide details how to install libraries on your computer. For an excellent
introduction to Arduino libraries and what you can do with them, see the Libraries page from
Arduino Tips, Tricks and Techniques (http://adafru.it/aYG).
There are two general types of Arduino Libraries:
Standard Libraries
The Arduino IDE comes with a set of standard libraries for commonly used functionality. These
libraries support all the examples included with the IDE. Standard library functionality includes
basic communication functions and support for some of the most common types of hardware
like: Servo Motors and Character LCD displays.
Standard Libraries are pre-installed in the "Libraries" folder of the Arduino install. If you have
multiple versions of the IDE installed, each version will have its own set of libraries.
Fo r the
mo st part, it is no t a go o d idea to change the Standard Libraries o r install yo ur
libraries in the same fo lder.
User Installed Libraries
There are many other libraries with useful functionality and device drivers for all sorts of
hardware. These drivers are available from places like Arduino Playground, Github and Google
Code. Adafruit provides over 100 libraries libraries supporting almost all of our Arduino
compatible products. Most of our libraries are hosted on
GitHub (http://adafru.it/aYH).
Direct
links are provided from the product description and/or tutorial pages.
User installed libraries sho uld be installed in yo ur sketchbo o k libraries fo lder
so they can be used with all versio ns o f the IDE. This way, if a new versio n o f
© Adafruit Industries http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use
Page 4 of 20
the IDE is released, yo u do n't have to re-install all yo ur favo rite libraries!
© Adafruit Industries http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use
Page 5 of 20
Zgłoś jeśli naruszono regulamin