feat: standardize all touch and UI beeps to crisp 4096 Hz chirp
This commit is contained in:
parent
1367d59aff
commit
cc33986acc
2 changed files with 9 additions and 9 deletions
|
|
@ -9,9 +9,9 @@ Configuration menu for OBD2 Gauge with volume and per-instrument alarm controls
|
||||||
#define FORMAT_SPIFFS_IF_FAILED true
|
#define FORMAT_SPIFFS_IF_FAILED true
|
||||||
|
|
||||||
/*------------ SOUND EFFECTS ----------*/
|
/*------------ SOUND EFFECTS ----------*/
|
||||||
// Classic Casio Watch Beep (F-91W / G-Shock Module 593: 32768 / 16 = 2048 Hz, exact C7 note)
|
// Crisp High-Pitch Casio Chirp (4096 Hz, 25ms)
|
||||||
inline void casioBeep(uint16_t freq = 2048, uint8_t duration_ms = 20) {
|
inline void casioBeep(uint16_t freq = 4096, uint8_t duration_ms = 25) {
|
||||||
uint16_t duty = VOL_DUTY_TABLE[buzzerVolumeLevel > 5 ? 2 : buzzerVolumeLevel];
|
uint16_t duty = VOL_DUTY_TABLE[buzzerVolumeLevel > 5 ? 3 : buzzerVolumeLevel];
|
||||||
if (duty == 0) return; // Mute mode
|
if (duty == 0) return; // Mute mode
|
||||||
ledcSetup(buzzerChannel, freq, 10);
|
ledcSetup(buzzerChannel, freq, 10);
|
||||||
ledcWrite(buzzerChannel, duty);
|
ledcWrite(buzzerChannel, duty);
|
||||||
|
|
@ -20,17 +20,17 @@ inline void casioBeep(uint16_t freq = 2048, uint8_t duration_ms = 20) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void beepbeep() {
|
void beepbeep() {
|
||||||
casioBeep(2048, 30);
|
casioBeep(4096, 25);
|
||||||
delay(30);
|
delay(30);
|
||||||
casioBeep(2048, 30);
|
casioBeep(4096, 25);
|
||||||
}
|
}
|
||||||
|
|
||||||
void beep() {
|
void beep() {
|
||||||
casioBeep(2048, 150);
|
casioBeep(4096, 40);
|
||||||
}
|
}
|
||||||
|
|
||||||
void clickSound() {
|
void clickSound() {
|
||||||
casioBeep(2048, 20);
|
casioBeep(4096, 25);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Configuration menu list (3 options)
|
// Configuration menu list (3 options)
|
||||||
|
|
@ -258,7 +258,7 @@ void volumeMenu() {
|
||||||
if (touchedLvl >= 0 && touchedLvl <= 5) {
|
if (touchedLvl >= 0 && touchedLvl <= 5) {
|
||||||
buzzerVolumeLevel = touchedLvl;
|
buzzerVolumeLevel = touchedLvl;
|
||||||
drawVolUI();
|
drawVolUI();
|
||||||
casioBeep(2048, 20); // Immediate acoustic feedback at selected volume
|
casioBeep(4096, 25); // Immediate acoustic feedback at selected volume
|
||||||
}
|
}
|
||||||
while (isScreenPressed()) { delay(10); yield(); }
|
while (isScreenPressed()) { delay(10); yield(); }
|
||||||
delay(50);
|
delay(50);
|
||||||
|
|
|
||||||
|
|
@ -378,7 +378,7 @@ void loop() {
|
||||||
lastTouchX = touchX;
|
lastTouchX = touchX;
|
||||||
lastTouchY = touchY;
|
lastTouchY = touchY;
|
||||||
longPressHandled = false;
|
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)) {
|
} else if (!longPressHandled && (millis() - touchStartTime > 1000)) {
|
||||||
// Long press (> 1s): Open Config Menu!
|
// Long press (> 1s): Open Config Menu!
|
||||||
longPressHandled = true;
|
longPressHandled = true;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue