aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32g4/src/bin/pwm.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/stm32g4/src/bin/pwm.rs')
-rw-r--r--examples/stm32g4/src/bin/pwm.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/stm32g4/src/bin/pwm.rs b/examples/stm32g4/src/bin/pwm.rs
index 01e9cb476..eed0b6ad7 100644
--- a/examples/stm32g4/src/bin/pwm.rs
+++ b/examples/stm32g4/src/bin/pwm.rs
@@ -8,7 +8,7 @@ use embassy_stm32::gpio::OutputType;
8use embassy_stm32::time::khz; 8use embassy_stm32::time::khz;
9use embassy_stm32::timer::simple_pwm::{PwmPin, SimplePwm}; 9use embassy_stm32::timer::simple_pwm::{PwmPin, SimplePwm};
10use embassy_stm32::timer::Channel; 10use embassy_stm32::timer::Channel;
11use embassy_time::{Duration, Timer}; 11use embassy_time::Timer;
12use {defmt_rtt as _, panic_probe as _}; 12use {defmt_rtt as _, panic_probe as _};
13 13
14#[embassy_executor::main] 14#[embassy_executor::main]
@@ -26,12 +26,12 @@ async fn main(_spawner: Spawner) {
26 26
27 loop { 27 loop {
28 pwm.set_duty(Channel::Ch1, 0); 28 pwm.set_duty(Channel::Ch1, 0);
29 Timer::after(Duration::from_millis(300)).await; 29 Timer::after_millis(300).await;
30 pwm.set_duty(Channel::Ch1, max / 4); 30 pwm.set_duty(Channel::Ch1, max / 4);
31 Timer::after(Duration::from_millis(300)).await; 31 Timer::after_millis(300).await;
32 pwm.set_duty(Channel::Ch1, max / 2); 32 pwm.set_duty(Channel::Ch1, max / 2);
33 Timer::after(Duration::from_millis(300)).await; 33 Timer::after_millis(300).await;
34 pwm.set_duty(Channel::Ch1, max - 1); 34 pwm.set_duty(Channel::Ch1, max - 1);
35 Timer::after(Duration::from_millis(300)).await; 35 Timer::after_millis(300).await;
36 } 36 }
37} 37}