diff --git a/src/buzzer.rs b/src/buzzer.rs index 2e46b0c..5e8e81e 100644 --- a/src/buzzer.rs +++ b/src/buzzer.rs @@ -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; } } diff --git a/src/main.rs b/src/main.rs index 7714bb4..c1d5f84 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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> { }; let store: Arc> = Arc::new(Mutex::new(raw_store)); - let gpio_buzzer: Arc> = Arc::new(Mutex::new(buzzer::GPIOBuzzer::new(4)?)); + let gpio_buzzer: Arc> = Arc::new(Mutex::new(buzzer::GPIOBuzzer::new(BUZZER_PIN)?)); let channel_store = store.clone(); tokio::spawn(async move {