Skip to content

Commit

Permalink
blinking red and green leds
Browse files Browse the repository at this point in the history
  • Loading branch information
ecruzolivera committed Oct 18, 2024
1 parent 8dde7b6 commit 3bcdfd6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions examples/stm32f4/src/bin/blinky.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,18 @@ async fn main(_spawner: Spawner) {
let p = embassy_stm32::init(Default::default());
info!("Hello World!");

let mut led = Output::new(p.PB7, Level::High, Speed::Low);
let mut led_green = Output::new(p.PG13, Level::High, Speed::Low);
let mut led_red = Output::new(p.PG14, Level::High, Speed::Low);

loop {
info!("high");
led.set_high();
led_green.set_high();
led_red.set_high();
Timer::after_millis(300).await;

info!("low");
led.set_low();
led_green.set_low();
led_red.set_low();
Timer::after_millis(300).await;
}
}

0 comments on commit 3bcdfd6

Please sign in to comment.