Basic project setup (#1)
Reviewed-on: https://git.mercurial-manifold.eu/an.tsouchlos/commonsense-sw/pulls/1 Co-authored-by: Andreas Tsouchlos <an.tsouchlos@gmail.com> Co-committed-by: Andreas Tsouchlos <an.tsouchlos@gmail.com>
This commit was merged in pull request #1.
This commit is contained in:
25
src/main.rs
Normal file
25
src/main.rs
Normal file
@@ -0,0 +1,25 @@
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
|
||||
use defmt::info;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_nrf::gpio::{Level, Output, OutputDrive};
|
||||
use embassy_time::Timer;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use nrf_softdevice::{raw, Softdevice};
|
||||
|
||||
#[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);
|
||||
|
||||
info!("Starting blinky");
|
||||
|
||||
loop {
|
||||
led.set_high();
|
||||
Timer::after_millis(300).await;
|
||||
led.set_low();
|
||||
Timer::after_millis(300).await;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user