aboutsummaryrefslogtreecommitdiff
path: root/docs/modules/ROOT/examples/basic/src
diff options
context:
space:
mode:
authorJoel Schulz-Andres <[email protected]>2024-05-23 15:34:16 +0200
committerGitHub <[email protected]>2024-05-23 15:34:16 +0200
commit0a5820e3ed423af1788072a5416e04ab86c44c2d (patch)
tree5a2b8d3d7a88835aebec0914da234d547e3b3dbe /docs/modules/ROOT/examples/basic/src
parent27e8ef6e7e720a3c74f7c696ab105915695431c5 (diff)
parentded1f9d33520fc847dce8fe72f2fb80f6fa86350 (diff)
Merge branch 'embassy-rs:main' into add-miso-pullup
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}