Firmware for the b-parasite board, but in Rust!
1use embassy_nrf::gpio::Output;
2use embassy_time::Timer;
3use sachy_fmt::unwrap;
4
5use crate::state::START_MEASUREMENTS;
6
7#[embassy_executor::task]
8pub async fn task(mut led: Output<'static>) {
9 let mut indication = unwrap!(START_MEASUREMENTS.receiver());
10
11 loop {
12 indication.changed().await;
13 for _ in 0..4 {
14 led.set_high();
15 Timer::after_millis(50).await;
16 led.set_low();
17 Timer::after_millis(450).await;
18 }
19 }
20}