Page 1 of 1

Where to install arduino libraries?

Posted: Mon Jul 06, 2015 8:24 am
by LEGEND383
I have followed the manual for the gertboard and have everything setup so I can write a program on the pi, compile it with gcc and then upload it to the gertduino using avrdude. Now I am trying to interface with some Adafruit neopixels, but have no idea where I am supposed to put the library. I have tried:
  • /home/pi/arduino/libraries
  • /home/pi/sketchbook/libraries
  • /home/pi/arduino/sketchbook/libraries
  • /usr/share/arduino/libraries
as well as various combinations of casing (Arduino instead of arduino, Libraries instead of libraries, Sketchbook instead of sketchbook). No matter what I try, when running make I get:

Code: Select all

fatal error: Adafruit_NeoPixel.h: No such file or directory
on the include line, which reads:

Code: Select all

#include <Adafruit_Neopixel.h>
I could compile the code on my laptop, transfer the hex file via sftp and then upload it to the gertduino, but that would defeat the purpose of the exercise in my opinion.

Re: Where to install arduino libraries?

Posted: Mon Jul 06, 2015 3:17 pm
by Gert van Loo
I am not familiar with that code.
If the include line is in your own code, you can use "..." instead of <....>
Then place the Adafruit include file in the same directory as your code.

Code: Select all

#include "Adafruit_Neopixel.h"
To use <....> you have to place the directory alongside the system include files.
I would have to look up where the Arduino GCC system include directory is on the Pi.
By the way: I ALWAYS use lower case names for include files. The safest way to go.

Even the QT guys use that despite their fondness of upper-case in names everywhere else.

Re: Where to install arduino libraries?

Posted: Tue Jul 07, 2015 1:32 pm
by panik
Note the capital 'P' in NeoPixel.

Code: Select all

#include <Adafruit_NeoPixel.h>
Libraries go in '/home/pi/sketchbook/libraries'. Also make sure the directory you put in there has the correct name (rename it to 'Adafruit_NeoPixel' if it hasn't got that name already).