A Swift driver for the PCA9685 PWM controller over I2C, using SwiftyGPIO.
A simple example looks like this:
// It doesn't really matter what Raspberry Pi Board you use.
// C.H.I.P. should also work.
let pca9685 = PCA9685(supportedBoard: .RaspberryPiPlusZero)
// This sets the frequency for all channels
// Range: 24 - 1526 Hz
pca9685.frequency = 1440 // Hz
// Can set an individual channel's on and off steps.
// Range: 0 - 4095 Steps
// Example: ~50% Duty Cycle
pca9685.setChannel(0, onStep: 0, offStep: 2048)
// Or all channels at once
pca9685.setAllChannels(onStep: 0, offStep: 0)
- SwiftyGPIO
- Adafruit-PCA9685 - Inspiration/Basis of Implementation.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
- Adam Thayer - Initial work - Kaiede
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE file for details