项目作者: Kaiede

项目描述 :
PCA9685 I2C Driver for Swift
高级语言: Swift
项目地址: git://github.com/Kaiede/PCA9685.git
创建时间: 2018-08-14T15:02:09Z
项目社区:https://github.com/Kaiede/PCA9685

开源协议:MIT License

下载


PCA9685

Build Status
MIT license

Swift
Swift
Swift

SwiftPM

Raspbian

A Swift driver for the PCA9685 PWM controller over I2C, using SwiftyGPIO.

Getting Started

A simple example looks like this:

  1. // It doesn't really matter what Raspberry Pi Board you use.
  2. // C.H.I.P. should also work.
  3. let pca9685 = PCA9685(supportedBoard: .RaspberryPiPlusZero)
  4. // This sets the frequency for all channels
  5. // Range: 24 - 1526 Hz
  6. pca9685.frequency = 1440 // Hz
  7. // Can set an individual channel's on and off steps.
  8. // Range: 0 - 4095 Steps
  9. // Example: ~50% Duty Cycle
  10. pca9685.setChannel(0, onStep: 0, offStep: 2048)
  11. // Or all channels at once
  12. pca9685.setAllChannels(onStep: 0, offStep: 0)

Built With

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Authors

  • Adam Thayer - Initial work - Kaiede

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details