Move blinky and temp/rh measurement into separate binaries
This commit is contained in:
24
src/bin/blinky.rs
Normal file
24
src/bin/blinky.rs
Normal file
@@ -0,0 +1,24 @@
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
|
||||
use defmt::info;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_nrf::gpio::{Level, Output, OutputDrive};
|
||||
use embassy_time::Timer;
|
||||
use nrf_softdevice::{raw, Softdevice};
|
||||
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_20, Level::Low, OutputDrive::Standard);
|
||||
|
||||
info!("Starting blinky");
|
||||
|
||||
loop {
|
||||
led.set_high();
|
||||
Timer::after_millis(300).await;
|
||||
led.set_low();
|
||||
Timer::after_millis(300).await;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,3 @@
|
||||
//! Example on how to read a 24C/24LC i2c eeprom.
|
||||
//!
|
||||
//! Connect SDA to P0.03, SCL to P0.04
|
||||
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
|
||||
@@ -47,29 +43,3 @@ async fn main(_spawner: Spawner) {
|
||||
Timer::after_millis(50).await;
|
||||
}
|
||||
}
|
||||
|
||||
// #![no_std]
|
||||
// #![no_main]
|
||||
//
|
||||
// use defmt::info;
|
||||
// use embassy_executor::Spawner;
|
||||
// use embassy_nrf::gpio::{Level, Output, OutputDrive};
|
||||
// use embassy_time::Timer;
|
||||
// use nrf_softdevice::{raw, Softdevice};
|
||||
// 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_20, Level::Low, OutputDrive::Standard);
|
||||
//
|
||||
// info!("Starting blinky");
|
||||
//
|
||||
// loop {
|
||||
// led.set_high();
|
||||
// Timer::after_millis(300).await;
|
||||
// led.set_low();
|
||||
// Timer::after_millis(300).await;
|
||||
// info!("Blinked");
|
||||
// }
|
||||
// }
|
||||
Reference in New Issue
Block a user