Move blinky and temp/rh measurement into separate binaries

This commit is contained in:
2025-09-30 10:07:43 +02:00
parent c785894ef9
commit b71a23cd67
4 changed files with 26 additions and 32 deletions

24
src/bin/blinky.rs Normal file
View 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;
}
}

View File

@@ -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");
// }
// }