Revert blinky changes for now
This commit is contained in:
parent
e93f2679b1
commit
9b01eed195
1 changed files with 9 additions and 12 deletions
|
@ -8,21 +8,18 @@ mod example_common;
|
|||
use defmt::unwrap;
|
||||
use embassy::executor::Spawner;
|
||||
use embassy::time::{Duration, Timer};
|
||||
use embassy_nrf::{Peripherals, peripherals::P0_13, gpio::{Level, Output, OutputDrive};
|
||||
use embassy_nrf::gpio::{Level, Output, OutputDrive};
|
||||
use embassy_nrf::Peripherals;
|
||||
use embedded_hal::digital::v2::OutputPin;
|
||||
|
||||
#[embassh::task]
|
||||
async fn blinker(led: Output<'static, P0_13>, interval: Duration) {
|
||||
loop {
|
||||
unwrap!(led.set_high());
|
||||
Timer::after(interval).await;
|
||||
unwrap!(led.set_low());
|
||||
Timer::after(interval).await;
|
||||
}
|
||||
}
|
||||
|
||||
#[embassy::main]
|
||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||
let mut led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard);
|
||||
unwrap!(spawner.spawn(blinker(led, Duration::from_millis(300))));
|
||||
|
||||
loop {
|
||||
unwrap!(led.set_high());
|
||||
Timer::after(Duration::from_millis(300)).await;
|
||||
unwrap!(led.set_low());
|
||||
Timer::after(Duration::from_millis(300)).await;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue