From cc33986acca6625c6ed1303c87811a018efbdcce Mon Sep 17 00:00:00 2001 From: Sebastian Nieto Date: Wed, 9 Sep 2026 23:31:26 -0300 Subject: [PATCH] feat: standardize all touch and UI beeps to crisp 4096 Hz chirp --- sketch/obd2_gauge/config.h | 16 ++++++++-------- sketch/obd2_gauge/obd2_gauge.ino | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sketch/obd2_gauge/config.h b/sketch/obd2_gauge/config.h index 2d1ece0..4081443 100644 --- a/sketch/obd2_gauge/config.h +++ b/sketch/obd2_gauge/config.h @@ -9,9 +9,9 @@ Configuration menu for OBD2 Gauge with volume and per-instrument alarm controls #define FORMAT_SPIFFS_IF_FAILED true /*------------ SOUND EFFECTS ----------*/ -// Classic Casio Watch Beep (F-91W / G-Shock Module 593: 32768 / 16 = 2048 Hz, exact C7 note) -inline void casioBeep(uint16_t freq = 2048, uint8_t duration_ms = 20) { - uint16_t duty = VOL_DUTY_TABLE[buzzerVolumeLevel > 5 ? 2 : buzzerVolumeLevel]; +// Crisp High-Pitch Casio Chirp (4096 Hz, 25ms) +inline void casioBeep(uint16_t freq = 4096, uint8_t duration_ms = 25) { + uint16_t duty = VOL_DUTY_TABLE[buzzerVolumeLevel > 5 ? 3 : buzzerVolumeLevel]; if (duty == 0) return; // Mute mode ledcSetup(buzzerChannel, freq, 10); ledcWrite(buzzerChannel, duty); @@ -20,17 +20,17 @@ inline void casioBeep(uint16_t freq = 2048, uint8_t duration_ms = 20) { } void beepbeep() { - casioBeep(2048, 30); + casioBeep(4096, 25); delay(30); - casioBeep(2048, 30); + casioBeep(4096, 25); } void beep() { - casioBeep(2048, 150); + casioBeep(4096, 40); } void clickSound() { - casioBeep(2048, 20); + casioBeep(4096, 25); } // Configuration menu list (3 options) @@ -258,7 +258,7 @@ void volumeMenu() { if (touchedLvl >= 0 && touchedLvl <= 5) { buzzerVolumeLevel = touchedLvl; drawVolUI(); - casioBeep(2048, 20); // Immediate acoustic feedback at selected volume + casioBeep(4096, 25); // Immediate acoustic feedback at selected volume } while (isScreenPressed()) { delay(10); yield(); } delay(50); diff --git a/sketch/obd2_gauge/obd2_gauge.ino b/sketch/obd2_gauge/obd2_gauge.ino index 4b613f8..53b8ea0 100644 --- a/sketch/obd2_gauge/obd2_gauge.ino +++ b/sketch/obd2_gauge/obd2_gauge.ino @@ -378,7 +378,7 @@ void loop() { lastTouchX = touchX; lastTouchY = touchY; longPressHandled = false; - casioBeep(2048, 20); // Soft, instant Casio beep ONLY on touch screen press! + casioBeep(4096, 25); // Crisp, bright Casio chirp on touch screen press! } else if (!longPressHandled && (millis() - touchStartTime > 1000)) { // Long press (> 1s): Open Config Menu! longPressHandled = true;