aboutsummaryrefslogtreecommitdiff
path: root/examples/rp/src/bin/blinky.rs
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2021-07-12 02:45:42 +0200
committerDario Nieuwenhuis <[email protected]>2021-07-12 03:45:57 +0200
commit7547c8d8d6800dd661dcda9f62ba988eefadd38e (patch)
tree078e4238487043136b4054e00862e4116f0bdbcc /examples/rp/src/bin/blinky.rs
parentc210a6efd1f77c4dd6c5df7b31e49c771ceb0cff (diff)
rp/timer: add
Diffstat (limited to 'examples/rp/src/bin/blinky.rs')
-rw-r--r--examples/rp/src/bin/blinky.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/rp/src/bin/blinky.rs b/examples/rp/src/bin/blinky.rs
index a162ed2f7..9c4767458 100644
--- a/examples/rp/src/bin/blinky.rs
+++ b/examples/rp/src/bin/blinky.rs
@@ -11,6 +11,7 @@ mod example_common;
11 11
12use defmt::*; 12use defmt::*;
13use embassy::executor::Spawner; 13use embassy::executor::Spawner;
14use embassy::time::{Duration, Timer};
14use embassy_rp::{gpio, Peripherals}; 15use embassy_rp::{gpio, Peripherals};
15use gpio::{Level, Output}; 16use gpio::{Level, Output};
16 17
@@ -21,10 +22,10 @@ async fn main(_spawner: Spawner, p: Peripherals) {
21 loop { 22 loop {
22 info!("led on!"); 23 info!("led on!");
23 led.set_high(); 24 led.set_high();
24 cortex_m::asm::delay(1_000_000); 25 Timer::after(Duration::from_secs(1)).await;
25 26
26 info!("led off!"); 27 info!("led off!");
27 led.set_low(); 28 led.set_low();
28 cortex_m::asm::delay(1_000_000); 29 Timer::after(Duration::from_secs(1)).await;
29 } 30 }
30} 31}