diff options
| author | Gustav Toft <[email protected]> | 2024-05-30 09:56:09 +0200 |
|---|---|---|
| committer | Gustav Toft <[email protected]> | 2024-05-30 09:56:09 +0200 |
| commit | d3c3670a966cd68b8d2d46a732ab971390ec3006 (patch) | |
| tree | e0815debd51e1baa5b019049e0ea1b1a286f7742 /docs/modules/ROOT/examples/basic/src/main.rs | |
| parent | ab36329dce653a2ee20d32e9a5345799d9595202 (diff) | |
| parent | 50210e8cdc95c3c8bea150541cd8f15482450b1e (diff) | |
Merge branch 'main' of https://github.com/embassy-rs/embassy into fix_main
Diffstat (limited to 'docs/modules/ROOT/examples/basic/src/main.rs')
| -rw-r--r-- | docs/modules/ROOT/examples/basic/src/main.rs | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/docs/modules/ROOT/examples/basic/src/main.rs b/docs/modules/ROOT/examples/basic/src/main.rs deleted file mode 100644 index 4412712c8..000000000 --- a/docs/modules/ROOT/examples/basic/src/main.rs +++ /dev/null | |||
| @@ -1,26 +0,0 @@ | |||
| 1 | #![no_std] | ||
| 2 | #![no_main] | ||
| 3 | |||
| 4 | use defmt::*; | ||
| 5 | use embassy_executor::Spawner; | ||
| 6 | use embassy_nrf::gpio::{Level, Output, OutputDrive}; | ||
| 7 | use embassy_time::{Duration, Timer}; | ||
| 8 | use {defmt_rtt as _, panic_probe as _}; // global logger | ||
| 9 | |||
| 10 | #[embassy_executor::task] | ||
| 11 | async fn blinker(mut led: Output<'static>, interval: Duration) { | ||
| 12 | loop { | ||
| 13 | led.set_high(); | ||
| 14 | Timer::after(interval).await; | ||
| 15 | led.set_low(); | ||
| 16 | Timer::after(interval).await; | ||
| 17 | } | ||
| 18 | } | ||
| 19 | |||
| 20 | #[embassy_executor::main] | ||
| 21 | async fn main(spawner: Spawner) { | ||
| 22 | let p = embassy_nrf::init(Default::default()); | ||
| 23 | |||
| 24 | let led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard); | ||
| 25 | unwrap!(spawner.spawn(blinker(led, Duration::from_millis(300)))); | ||
| 26 | } | ||
