fixed some buzzer timings

This commit is contained in:
PC_WSL 2025-05-05 14:42:33 +02:00
parent 01454a018d
commit 8fd8081ced
2 changed files with 9 additions and 8 deletions

View File

@ -38,19 +38,19 @@ impl GPIOBuzzer {
}
pub async fn beep_ack(&mut self) {
// carrier = 2300 Hz, sound = 440 Hz, duration = 1 sec
self.modulated_tone(2300, 500, 500).await;
self.modulated_tone(2300, 700, 500).await;
self.modulated_tone(2300, 659, 400).await;
self.modulated_tone(2300, 784,100).await;
}
pub async fn beep_nak(&mut self) {
// carrier = 2300 Hz, sound = 440 Hz, duration = 1 sec
self.modulated_tone(2300, 700, 500).await;
self.modulated_tone(2300, 500, 500).await;
self.modulated_tone(2300, 659, 400).await;
self.modulated_tone(2300, 523, 100).await;
}
pub async fn beep_unnkown(&mut self) {
self.modulated_tone(2300, 500, 500).await;
self.modulated_tone(2300, 500, 500).await;
self.modulated_tone(2300, 500, 500).await;
self.modulated_tone(2300, 784, 150).await;
self.modulated_tone(2300, 659, 150).await;
self.modulated_tone(2300, 500, 150).await;
}
}

View File

@ -20,6 +20,7 @@ mod pm3;
mod webserver;
const STORE_PATH: &str = "./data.json";
const BUZZER_PIN: u8 = 26;
fn setup_logger() {
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 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();
tokio::spawn(async move {