Add embassy-nrf blinky example

This commit is contained in:
2024-11-01 16:31:14 +01:00
parent bc6bf765fa
commit 5a60fc926f
7 changed files with 960 additions and 7 deletions

21
src/main.rs Normal file
View File

@@ -0,0 +1,21 @@
#![no_std]
#![no_main]
use embassy_executor::Spawner;
use embassy_nrf::gpio::{Level, Output, OutputDrive};
use embassy_time::Timer;
use {defmt_rtt as _, panic_probe as _};
#[embassy_executor::main]
async fn main(_spawner: Spawner) {
let p = embassy_nrf::init(Default::default());
let mut led = Output::new(p.P0_18, Level::Low, OutputDrive::Standard);
loop {
led.set_high();
Timer::after_millis(300).await;
led.set_low();
Timer::after_millis(300).await;
}
}