diff --git a/sketch/obd2_gauge/config.h b/sketch/obd2_gauge/config.h index 779959e..7f8b1fc 100644 --- a/sketch/obd2_gauge/config.h +++ b/sketch/obd2_gauge/config.h @@ -9,26 +9,25 @@ Configuration menu for OBD2 Gauge #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 = 24) { + ledcWriteTone(buzzerChannel, freq); + delay(duration_ms); + ledcWriteTone(buzzerChannel, 0); +} + void beepbeep() { - ledcWriteTone(buzzerChannel, 2000); - delay(50); - ledcWriteTone(buzzerChannel, 0); - delay(50); - ledcWriteTone(buzzerChannel, 2000); - delay(50); - ledcWriteTone(buzzerChannel, 0); + casioBeep(2048, 35); + delay(35); + casioBeep(2048, 35); } void beep() { - ledcWriteTone(buzzerChannel, 2000); - delay(500); - ledcWriteTone(buzzerChannel, 0); + casioBeep(2048, 200); } void clickSound() { - ledcWriteTone(buzzerChannel, 5000); - delay(5); - ledcWriteTone(buzzerChannel, 0); + casioBeep(2048, 24); } // Configuration menu list diff --git a/sketch/obd2_gauge/obd2_gauge.ino b/sketch/obd2_gauge/obd2_gauge.ino index ac198f9..39a7aa9 100644 --- a/sketch/obd2_gauge/obd2_gauge.ino +++ b/sketch/obd2_gauge/obd2_gauge.ino @@ -368,13 +368,12 @@ void loop() { lastTouchX = touchX; lastTouchY = touchY; longPressHandled = false; + casioBeep(2048, 24); // Instant Casio beep on every screen touch! } else if (!longPressHandled && (millis() - touchStartTime > 1000)) { // Long press (> 1s) or button hold: Open Config Menu! longPressHandled = true; clickCount = 0; - ledcWriteTone(buzzerChannel, 3500); - delay(40); - ledcWriteTone(buzzerChannel, 0); + casioBeep(4096, 35); // High confirmation beep configMenu(); if (foundOBD2) initScreen(); isTouching = false; @@ -395,13 +394,7 @@ void loop() { if ((millis() - firstClickTime < 400) && (quad == clickQuadrant || fullScreenCell != -1)) { // DOUBLE CLICK DETECTED! clickCount = 0; - ledcWriteTone(buzzerChannel, 5000); - delay(15); - ledcWriteTone(buzzerChannel, 0); - delay(40); - ledcWriteTone(buzzerChannel, 5000); - delay(15); - ledcWriteTone(buzzerChannel, 0); + casioBeep(4096, 20); // High confirmation beep on double tap if (fullScreenCell == -1) { fullScreenCell = quad; @@ -422,9 +415,6 @@ void loop() { // Handle single click timeout (after 400ms without a second tap) if (clickCount == 1 && (millis() - firstClickTime >= 400)) { clickCount = 0; - ledcWriteTone(buzzerChannel, 4500); - delay(15); - ledcWriteTone(buzzerChannel, 0); if (fullScreenCell != -1) { // In full screen: single click toggles between arc and number mode without header flicker