Search code examples
linuxdriversbeagleboneblack

I want to utilize PCA9685 chip to drive servos on beaglebone black, I see there is a linux driver, but how to utilize in C/C++. Any examples?


So I have a Beaglebone black, and a servo/led controller http://www.adafruit.com/product/815. I'd like to control it from a C/C++ program running on the included Debian Linux.

I see there is a driver included in the kernel "pwm_pca9685", and it did create some items in the /sys directory, but nothing that seems to make any sense.

So I know that at least I need to tell the module what i2c address the chip has, so how would I do that, and then how to send various pwm commands to chip?


Solution

  • So I ended up forgoing the use of the driver, as I was unable to find any information on it. Instead I used various ioctl calls, such as is used in this code from Adafruit: https://github.com/adafruit/Adafruit-PWM-Servo-Driver-Library/blob/master/Adafruit_PWMServoDriver.cpp