Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Kaiede/PCA9685
PCA9685 I2C Driver for Swift
https://github.com/Kaiede/PCA9685
raspberry-pi raspberry-pi-gpio swift swiftygpio
Last synced: about 1 month ago
JSON representation
PCA9685 I2C Driver for Swift
- Host: GitHub
- URL: https://github.com/Kaiede/PCA9685
- Owner: Kaiede
- License: mit
- Created: 2018-08-14T15:02:09.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-11-07T22:23:52.000Z (about 5 years ago)
- Last Synced: 2024-10-30T17:24:48.813Z (about 1 month ago)
- Topics: raspberry-pi, raspberry-pi-gpio, swift, swiftygpio
- Language: Swift
- Size: 15.6 KB
- Stars: 5
- Watchers: 1
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-embedded-swift - PCA9685 - PCA9685 I2C Driver for Swift (Sensors / Networking, IoT, Bus Protocols, …)
README
# PCA9685
[![Build Status](https://github.com/Kaiede/PCA9685/workflows/CI/badge.svg)](https://github.com/Kaiede/PCA9685/actions)
[![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)![Swift](https://img.shields.io/badge/Swift-5.x-brightgreen.svg?style=flat)
![Swift](https://img.shields.io/badge/Swift-4.x-brightgreen.svg?style=flat)
![Swift](https://img.shields.io/badge/Swift-3.x-brightgreen.svg?style=flat)![SwiftPM](https://img.shields.io/badge/SwiftPM-✔-blue.svg?style=flat)
![Raspbian](https://img.shields.io/badge/OS-Raspbian-green.svg)
A Swift driver for the PCA9685 PWM controller over I2C, using SwiftyGPIO.
## Getting Started
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)
```## Built With
* [SwiftyGPIO](https://github.com/uraimo/SwiftyGPIO)
* [Adafruit-PCA9685](https://github.com/adafruit/Adafruit_Python_PCA9685) - Inspiration/Basis of Implementation.## Contributing
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
## Authors
* **Adam Thayer** - *Initial work* - [Kaiede](https://github.com/Kaiede)
See also the list of [contributors](https://github.com/Kaiede/RPiLight/contributors) who participated in this project.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details