0

I cloned https://github.com/sparkfun/APDS-9960_RGB_and_Gesture_Sensor and copied the libraries into the Arduino libraries folder. I then launched Arduino and selected the example. I opened the file GestureTest and when I started upload I received this error:

GestureTest.ino:49:31: fatal error: SparkFun_APDS9960.h: No such file or directory

compilation terminated.

I checked the SparkFun_APDS9960.h and I found it in the Gesture_Sensor/Libraries/src folder.

Is there a solution to resolve this error?

1 Answer 1

0

SparkFun made a poor choice for the folder structure of that repository. Likely this has caused you to incorrectly install the library. Please follow these instructions:

  1. Download the latest release from https://github.com/sparkfun/APDS-9960_RGB_and_Gesture_Sensor/releases. Currently it is https://github.com/sparkfun/APDS-9960_RGB_and_Gesture_Sensor/archive/V_H1.0_L1.4.2.zip.
  2. Unzip the downloaded file.
  3. Rename the folder APDS-9960_RGB_and_Gesture_Sensor-V_H1.0_L1.4.2/Libraries/Arduino to SparkFun_APDS9960. This is not absolutely necessary but "Arduino" is not a very descriptive name for a library folder and the Arduino IDE works best when the library folder name matches the primary header file name so this is best practices.
  4. Copy the SparkFun_APDS9960 folder to {sketchbook folder}/libraries. You can find the location of the sketchbook folder at File > Preferences > Sketchbook location.
  5. Restart the Arduino IDE if it's running (not necessary with recent versions of the Arduino IDE).

Note that the folder structure of this library requires Arduino 1.6.x or newer.

UPDATE: I submitted a pull request to put the library in an appropriately named folder. This won't change the instructions above until the next release but it does remove the need to rename the folder if you are cloning the repository or downloading from the tip of the repository rather than a release.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.