Posts: 9
Joined: Tue Mar 11, 2014 9:01 pm

Where to install arduino libraries?

Mon Jul 06, 2015 8:24 am

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.

User avatar
Gert van Loo
Posts: 2486
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: Where to install arduino libraries?

Mon Jul 06, 2015 3:17 pm

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.

User avatar
Posts: 369
Joined: Fri Sep 23, 2011 12:29 pm
Location: Netherlands

Re: Where to install arduino libraries?

Tue Jul 07, 2015 1:32 pm

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).
Microcontroller addon boards and software for Raspberry Pi A+/B+/Pi2:
- ARMinARM: ARM Cortex-M3 (STM32)
- AVRPi: ATmega32U4 & ATmega328 ("Arduino")

Return to “HATs and other add-ons”