mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-07-30 16:58:12 +00:00
Settings: add buzzer volume control (5 levels, like brightness)
- NodePrefs: add buzzer_volume field (0=min..4=max, default 4) - DataStore: persist buzzer_volume at end of prefs file (backward-compat) - buzzer: setVolume()/getVolume(); applyVolume() sets PWM duty cycle via analogWrite() after each rtttl::play() call to control output amplitude - Settings UI: new BzrVol bar item in Sound section (left/right to adjust) - UITask: apply saved volume on startup alongside brightness Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -28,8 +28,12 @@ class genericBuzzer
|
||||
bool isPlaying(); // returns true if a sound is still playing else false
|
||||
void quiet(bool buzzer_state); // enables or disables the buzzer
|
||||
bool isQuiet(); // get buzzer state on/off
|
||||
void setVolume(uint8_t level); // 0=min..4=max
|
||||
uint8_t getVolume() const { return _volume_level; }
|
||||
|
||||
private:
|
||||
uint8_t _volume_level = 4;
|
||||
void applyVolume();
|
||||
// gemini's picks:
|
||||
const char *startup_song = "Startup:d=4,o=5,b=160:16c6,16e6,8g6";
|
||||
const char *shutdown_song = "Shutdown:d=4,o=5,b=100:8g5,16e5,16c5";
|
||||
|
||||
Reference in New Issue
Block a user