Skip to content

Commit

Permalink
Enable the pwm_device before use
Browse files Browse the repository at this point in the history
  • Loading branch information
kknives committed Jan 21, 2023
1 parent c34335e commit dd703c6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ impl LocalConnections {
sleep(Duration::from_millis(100)).await;

let dev = I2cdev::new(config.pca9685_path).unwrap();
let pwm_device = Pca9685::new(dev, pca9685::Address::default()).unwrap();
let mut pwm_device = Pca9685::new(dev, pca9685::Address::default()).unwrap();
pwm_device.set_prescale(100).unwrap();
pwm_device.enable().unwrap();
// pwm.set_all_on_off(&[0; 16], &[0; 16]).unwrap();


let servos: HashMap<String, Channel> = config
.servos
Expand Down

0 comments on commit dd703c6

Please # to comment.