softpwm/
softpwm.rs

1use rust_gpiozero::*;
2use std::io;
3use std::io::prelude::*;
4
5fn main() {
6    // Create a new LED attached to Pin 17
7    let mut led = PWMLED::new(17);
8
9    // blink the LED 5 times
10    led.set_blink_count(5);
11    led.blink(2.0, 2.0, 1.0, 1.0);
12
13    // wait for key press to exit
14    let _ = io::stdin().read(&mut [0u8]).unwrap();
15}