aboutsummaryrefslogtreecommitdiff
path: root/docs/modules/ROOT/examples/basic/src
diff options
context:
space:
mode:
authorGustav Toft <[email protected]>2024-05-30 09:56:09 +0200
committerGustav Toft <[email protected]>2024-05-30 09:56:09 +0200
commitd3c3670a966cd68b8d2d46a732ab971390ec3006 (patch)
treee0815debd51e1baa5b019049e0ea1b1a286f7742 /docs/modules/ROOT/examples/basic/src
parentab36329dce653a2ee20d32e9a5345799d9595202 (diff)
parent50210e8cdc95c3c8bea150541cd8f15482450b1e (diff)
Merge branch 'main' of https://github.com/embassy-rs/embassy into fix_main
Diffstat (limited to 'docs/modules/ROOT/examples/basic/src')
-rw-r--r--docs/modules/ROOT/examples/basic/src/main.rs26
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
4use defmt::*;
5use embassy_executor::Spawner;
6use embassy_nrf::gpio::{Level, Output, OutputDrive};
7use embassy_time::{Duration, Timer};
8use {defmt_rtt as _, panic_probe as _}; // global logger
9
10#[embassy_executor::task]
11async 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]
21async 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}