mirror of
https://github.com/Djeeberjr/fw-anwesenheit.git
synced 2025-07-05 02:14:17 +00:00
fixed some buzzer timings
This commit is contained in:
parent
01454a018d
commit
8fd8081ced
@ -38,19 +38,19 @@ impl GPIOBuzzer {
|
|||||||
}
|
}
|
||||||
pub async fn beep_ack(&mut self) {
|
pub async fn beep_ack(&mut self) {
|
||||||
// carrier = 2300 Hz, sound = 440 Hz, duration = 1 sec
|
// carrier = 2300 Hz, sound = 440 Hz, duration = 1 sec
|
||||||
self.modulated_tone(2300, 500, 500).await;
|
self.modulated_tone(2300, 659, 400).await;
|
||||||
self.modulated_tone(2300, 700, 500).await;
|
self.modulated_tone(2300, 784,100).await;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn beep_nak(&mut self) {
|
pub async fn beep_nak(&mut self) {
|
||||||
// carrier = 2300 Hz, sound = 440 Hz, duration = 1 sec
|
// carrier = 2300 Hz, sound = 440 Hz, duration = 1 sec
|
||||||
self.modulated_tone(2300, 700, 500).await;
|
self.modulated_tone(2300, 659, 400).await;
|
||||||
self.modulated_tone(2300, 500, 500).await;
|
self.modulated_tone(2300, 523, 100).await;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn beep_unnkown(&mut self) {
|
pub async fn beep_unnkown(&mut self) {
|
||||||
self.modulated_tone(2300, 500, 500).await;
|
self.modulated_tone(2300, 784, 150).await;
|
||||||
self.modulated_tone(2300, 500, 500).await;
|
self.modulated_tone(2300, 659, 150).await;
|
||||||
self.modulated_tone(2300, 500, 500).await;
|
self.modulated_tone(2300, 500, 150).await;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@ mod pm3;
|
|||||||
mod webserver;
|
mod webserver;
|
||||||
|
|
||||||
const STORE_PATH: &str = "./data.json";
|
const STORE_PATH: &str = "./data.json";
|
||||||
|
const BUZZER_PIN: u8 = 26;
|
||||||
|
|
||||||
fn setup_logger() {
|
fn setup_logger() {
|
||||||
let log_level = env::var("LOG_LEVEL")
|
let log_level = env::var("LOG_LEVEL")
|
||||||
@ -70,7 +71,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let store: Arc<Mutex<IDStore>> = Arc::new(Mutex::new(raw_store));
|
let store: Arc<Mutex<IDStore>> = Arc::new(Mutex::new(raw_store));
|
||||||
let gpio_buzzer: Arc<Mutex<GPIOBuzzer>> = Arc::new(Mutex::new(buzzer::GPIOBuzzer::new(4)?));
|
let gpio_buzzer: Arc<Mutex<GPIOBuzzer>> = Arc::new(Mutex::new(buzzer::GPIOBuzzer::new(BUZZER_PIN)?));
|
||||||
|
|
||||||
let channel_store = store.clone();
|
let channel_store = store.clone();
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user