Skip to content

Python driver module for PCA9685 pwm (LED/Servo) controller

License

Notifications You must be signed in to change notification settings

voidpp/PCA9685-driver

Repository files navigation

Build Status Coverage Status

About

Driver for PCA9685 controller. Datasheet: https://www.adafruit.com/datasheets/PCA9685.pdf

Install

Some system packages are mandatory for smbus-cffi:

sudo apt-get install build-essential libi2c-dev i2c-tools python-dev libffi-dev

Now install the driver from pip

pip install PCA9685-driver

Example

from pca9685_driver import Device

# 0x40 from i2cdetect -y 1 (1 if Raspberry pi 2)
dev = Device(0x40)

# set the duty cycle for LED05 to 50%
dev.set_pwm(5, 2047)

# set the pwm frequency (Hz)
dev.set_pwm_frequency(1000)

Hardware environment

This driver tested only with Raspberry Pi 2 and Adafruit 16-Channel 12-bit PWM/Servo Driver

About

Python driver module for PCA9685 pwm (LED/Servo) controller

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages