I’ve uploaded a Linux PCA9685 library with a servo motor example in C++ to my github repo. I don’t quite remember where the library came. But the servo_example.cpp is mine. It is pretty simple code. The code compiles fine and runs on a Raspberry Pi 3. It compiles fine under Fedora 25, too.
https://github.com/chaoticmachinery/pca9685
To install:
- tar zxvf pca9685.tar.gz
- cd pca9685
- make
- cp libPCA9685.so.0.1 /usr/local/lib
- cd /usr/local/lib
- ln -s libPCA9685.so.0.1 libPCA9685.so.0
- ln -s libPCA9685.so.0.1 libPCA9685.so
- make sure /usr/local/lib is in /etc/ld.so.conf
- ldconfig
- cd back to pca9685 directory
- To make the servo example: ./make_servo_example.sh
There is code in there for LED controls. I haven’t tested it.
K Murphy