adafruit / Adafruit_APDS9960

Arduino drivers for APDS9960 gesture sensor
Other
38 stars 45 forks source link

Add Raspberry PI support to Adafruit_APDS9960 #12

Closed flavio-fernandes closed 6 years ago

flavio-fernandes commented 6 years ago

This is a non-intrusive way of using this library on RPI. It runs faster than python, but possibly not as portable.

Here are the steps for building and linking a c++ program with it:

echo do these once, so your program is able to use wiringPi
sudo apt-get update
sudo apt-get install -y git build-essential g++
git clone git://git.drogon.net/wiringPi && cd wiringPi && ./build

cd ~/Adafruit_APDS9960.git ; # wherever this repo is located!
g++ -DRASPBERRY_PI -c Adafruit_APDS9960.cpp

cd examples/gesture_sensor
g++ -DRASPBERRY_PI -x c++ -o gesture_sensor.o -c gesture_sensor.ino -I ../..
g++ -DRASPBERRY_PI -o gesture_sensor  gesture_sensor.o  ../../Adafruit_APDS9960.o -lwiringPi
sudo ./gesture_sensor

cd ../../examples/proximity_sensor/
g++ -DRASPBERRY_PI -x c++ -o proximity_sensor.o -c proximity_sensor.ino -I ../..
g++ -DRASPBERRY_PI -o proximity_sensor  proximity_sensor.o  ../../Adafruit_APDS9960.o -lwiringPi
sudo ./proximity_sensor

cd ../../examples/color_sensor/
g++ -DRASPBERRY_PI -x c++ -o color_sensor.o -c color_sensor.ino -I ../..
g++ -DRASPBERRY_PI -o color_sensor  color_sensor.o  ../../Adafruit_APDS9960.o -lwiringPi
sudo ./color_sensor
ladyada commented 6 years ago

hiya tahnk you but we wouldnt accept this, we only support python on raspberry pi! https://learn.adafruit.com/adafruit-apds9960-breakout/circuitpython

flavio-fernandes commented 6 years ago

no worries @ladyada ! I will do a show and tell later to share with you the cool stuff I plan on doing with this.

ladyada commented 6 years ago

awesome, thanks for understanding - C/C++ is really hard to support long term on linux :(