| Crates.io | pca9685-rppal |
| lib.rs | pca9685-rppal |
| version | 0.1.0 |
| created_at | 2025-01-27 11:40:35.92865+00 |
| updated_at | 2025-01-27 11:40:35.92865+00 |
| description | Raspberry Pi Wrapper for the Adafruit PCA9685 Servo/PWM Driver |
| homepage | |
| repository | https://github.com/BradenEverson/pca9685-rppal |
| max_upload_size | |
| id | 1532336 |
| size | 12,820 |
A rppal-based Rust library for interacting with the Adafruit PCA9685 16-channel PWM/Servo Driver on Raspberry Pi. This library wraps the lower-level I²C operations to simplify setting up the PCA9685 and controlling PWM channels.
0x40).rppal crate (installed automatically as a dependency).Add the following to your project's Cargo.toml:
[dependencies]
pca9685-rppal = "0.1.0"
You can initialize a device, set the PWM frequency and control a single or all channels at once!
let mut pca = Pca9685::new()?;
pca.init()?;
pca.set_pwm_freq(50.0)?;
pca.set_pwm(0, 0, 1500)?;
pca9685.set_all_pwm(0, 0)?;
Special thanks to the rppal crate for acting as a base to this crate and to adafruit_pwm_servo_driver for generic implementation details :)