added loop code at the end of main

This commit is contained in:
aOK 2024-06-09 15:08:12 +03:00
parent da2d6dd2c2
commit bb1349d903
3 changed files with 9 additions and 2 deletions

View File

@ -87,4 +87,9 @@ async fn main(spawner: Spawner) {
let _ = spawner let _ = spawner
.spawn(relay_task(relay_pin, encoder_channel.receiver())) .spawn(relay_task(relay_pin, encoder_channel.receiver()))
.unwrap(); .unwrap();
loop {
esp_println::println!("Bing!");
embassy_time::Timer::after(embassy_time::Duration::from_millis(5_000)).await;
}
} }

View File

@ -1,3 +1,5 @@
extern crate embassy_executor;
use crate::confg::Sens; use crate::confg::Sens;
use embassy_sync::{blocking_mutex::raw::NoopRawMutex, channel::Receiver}; use embassy_sync::{blocking_mutex::raw::NoopRawMutex, channel::Receiver};
use embassy_time::{Duration, Timer}; use embassy_time::{Duration, Timer};

View File

@ -1,6 +1,6 @@
use crate::confg::Sens;
extern crate embassy_executor; extern crate embassy_executor;
use crate::confg::Sens;
use embassy_sync::{blocking_mutex::raw::NoopRawMutex, channel::Receiver}; use embassy_sync::{blocking_mutex::raw::NoopRawMutex, channel::Receiver};
use esp_println::println; use esp_println::println;
use hal::gpio::{Gpio2, Output}; use hal::gpio::{Gpio2, Output};