Hardware Reference
In-Depth Information
A new window opens. Select the Zip i le that you downloaded. Didn't work,
did it? You should have an error message at the bottom of the screen.
This is one of the problems when importing libraries: the naming convention.
The Arduino IDE cannot read the dash in the i lename, so why was it there?
Adafruit did not name its library like that; if you look at the Adafruit and Github
pages, the repository name is Adafruit_SI1145_Library , no dash. The dash is
added by a Git convention, adding -master to the end of the compressed i le-
name. Git repositories can have several “branches,” different areas of code that
can be modii ed independently from the rest of the code. This is used from time
to time to test new functionality, and if everything goes to plan, that branch is
then merged back into the main repository, called master.
The Zip i le cannot be used as it is. You cannot simply rename the Zip i le
because it contains a folder with a dash in the name. To import this library, you
have to try something else: extract the contents. Most operating systems have
native support for Zip i les. Extract the contents of the Zip i le to a location on
your hard drive. The result should be a folder name called Adafruit_SI1145_
Library-master . Rename this folder Adafruit_SI1145_Library . Now, import
this folder. As before, go to the Sketch
Add Library menu
item. Select the folder (without going inside the folder) and press OK. If every-
thing goes well, you will have a new message on your Arduino IDE, like the
one shown in Figure 24-6.
Import Library
Figure 24-6: Successful library import
Search WWH ::




Custom Search