Hardware Reference
In-Depth Information
exists. The same goes for other electronic components. To use these libraries, you
need to search online to see if there is something available.
Libraries are, put simply, source code i les. There are sites that are dedicated to
hosting open source projects and handling source code. These sites allow other
users to retrieve the source code and to suggest modii cations and corrections if
required. A single open source project can have hundreds of developers, each
proposing a change or adding their code to an existing project. One such site
is GitHub ( http://github.com ).
NOTE GitHub gets its name from the open-source code management program, Git.
It allows users to use this application to download the source code, upload changes,
and to create parallel versions. Although the site is optimized for Git, you do not need
to use this program; projects can be downloaded as a Zip fi le.
On the top of the screen, GitHub allows you to make a search of the available
projects. Give it a try. This chapter will use Silicon Lab's SI1145 UV sensor. Enter
Arduino si1145 in the search i eld, and then press Search. There are dozens
of responses, but you can change the order of the results, either by stars (the
amount of popularity a project has), forks (the amount of times this library has
been used to create another project), or recently updated (the last time the project
was updated). Best Match, the default setting, uses all three to create the best
solution and displays those results i rst.
NOTE Adafruit also uses Github for its libraries.
One of the best sources of information, not only for libraries but for everything
to do with Arduino, is the Arduino Forum.
Importing a Library
To import a third-party library, you can use the Arduino IDE. When you go
into the Sketch
Import Library menu, you have the choice of importing a
standard Arduino library, but there is also an Add Library menu item, as shown
in Figure 24-1.
Clicking this menu item opens a new window, prompting you to select a
Zip i le or folder containing the library you want to import. A Linux computer
shows a window like the one in Figure 24-2.
 
Search WWH ::




Custom Search