From e7761dc9dccc54fa900a743006368a3b678c652e Mon Sep 17 00:00:00 2001 From: JQ Date: Tue, 27 May 2025 19:10:56 -0700 Subject: [PATCH 1/7] initial button manager --- examples/companion_radio/Button.cpp | 127 ++++++++++++++++++++++++++++ examples/companion_radio/Button.h | 77 +++++++++++++++++ examples/companion_radio/UITask.cpp | 118 +++++++++++++++----------- examples/companion_radio/UITask.h | 15 +++- 4 files changed, 288 insertions(+), 49 deletions(-) create mode 100644 examples/companion_radio/Button.cpp create mode 100644 examples/companion_radio/Button.h diff --git a/examples/companion_radio/Button.cpp b/examples/companion_radio/Button.cpp new file mode 100644 index 00000000..161bb6aa --- /dev/null +++ b/examples/companion_radio/Button.cpp @@ -0,0 +1,127 @@ +#include "Button.h" + +Button::Button(uint8_t pin, bool activeState) + : _pin(pin), _activeState(activeState), _isAnalog(false), _analogThreshold(20) { + _currentState = !_activeState; + _lastState = _currentState; +} + +Button::Button(uint8_t pin, bool activeState, bool isAnalog, uint16_t analogThreshold) + : _pin(pin), _activeState(activeState), _isAnalog(isAnalog), _analogThreshold(analogThreshold) { + _currentState = !_activeState; + _lastState = _currentState; +} + +void Button::begin() { + if (!_isAnalog) { + pinMode(_pin, INPUT_PULLUP); + } + _currentState = readButton(); + _lastState = _currentState; +} + +void Button::update() { + uint32_t now = millis(); + + // Read button at specified interval + if (now - _lastReadTime < BUTTON_READ_INTERVAL_MS) { + return; + } + _lastReadTime = now; + + bool newState = readButton(); + + // Check if state has changed + if (newState != _lastState) { + _stateChangeTime = now; + } + + // Debounce check + if ((now - _stateChangeTime) > BUTTON_DEBOUNCE_TIME_MS) { + if (newState != _currentState) { + _currentState = newState; + handleStateChange(); + } + } + + _lastState = newState; + + // Handle multi-click timeout + if (_state == WAITING_FOR_MULTI_CLICK && (now - _releaseTime) > BUTTON_CLICK_TIMEOUT_MS) { + // Timeout reached, process the clicks + if (_clickCount == 1) { + triggerEvent(SHORT_PRESS); + } else if (_clickCount == 2) { + triggerEvent(DOUBLE_PRESS); + } else if (_clickCount >= 3) { + triggerEvent(TRIPLE_PRESS); + } + _clickCount = 0; + _state = IDLE; + } + + // Handle long press + if (_state == PRESSED && (now - _pressTime) > BUTTON_LONG_PRESS_TIME_MS) { + triggerEvent(LONG_PRESS); + _state = IDLE; // Prevent multiple long press events + _clickCount = 0; + } +} + +bool Button::readButton() { + if (_isAnalog) { + return (analogRead(_pin) < _analogThreshold) ? _activeState : !_activeState; + } else { + return digitalRead(_pin); + } +} + +void Button::handleStateChange() { + uint32_t now = millis(); + + if (_currentState == _activeState) { + // Button pressed + _pressTime = now; + _state = PRESSED; + triggerEvent(ANY_PRESS); + } else { + // Button released + if (_state == PRESSED) { + uint32_t pressDuration = now - _pressTime; + + if (pressDuration < BUTTON_LONG_PRESS_TIME_MS) { + // Short press detected + _clickCount++; + _releaseTime = now; + _state = WAITING_FOR_MULTI_CLICK; + } else { + // Long press already handled in update() + _state = IDLE; + } + } + } +} + +void Button::triggerEvent(EventType event) { + _lastEvent = event; + + switch (event) { + case ANY_PRESS: + if (_onAnyPress) _onAnyPress(); + break; + case SHORT_PRESS: + if (_onShortPress) _onShortPress(); + break; + case DOUBLE_PRESS: + if (_onDoublePress) _onDoublePress(); + break; + case TRIPLE_PRESS: + if (_onTriplePress) _onTriplePress(); + break; + case LONG_PRESS: + if (_onLongPress) _onLongPress(); + break; + default: + break; + } +} \ No newline at end of file diff --git a/examples/companion_radio/Button.h b/examples/companion_radio/Button.h new file mode 100644 index 00000000..a7406824 --- /dev/null +++ b/examples/companion_radio/Button.h @@ -0,0 +1,77 @@ +#pragma once + +#include +#include + +// Button timing configuration +#define BUTTON_DEBOUNCE_TIME_MS 50 // Debounce time in ms +#define BUTTON_CLICK_TIMEOUT_MS 400 // Max time between clicks for multi-click +#define BUTTON_LONG_PRESS_TIME_MS 5000 // Time to trigger long press (5 seconds) +#define BUTTON_READ_INTERVAL_MS 10 // How often to read the button + +class Button { +public: + enum EventType { + NONE, + SHORT_PRESS, + DOUBLE_PRESS, + TRIPLE_PRESS, + LONG_PRESS, + ANY_PRESS + }; + + using EventCallback = std::function; + + Button(uint8_t pin, bool activeState = LOW); + Button(uint8_t pin, bool activeState, bool isAnalog, uint16_t analogThreshold = 20); + + void begin(); + void update(); + + // Set callbacks for different events + void onShortPress(EventCallback callback) { _onShortPress = callback; } + void onDoublePress(EventCallback callback) { _onDoublePress = callback; } + void onTriplePress(EventCallback callback) { _onTriplePress = callback; } + void onLongPress(EventCallback callback) { _onLongPress = callback; } + void onAnyPress(EventCallback callback) { _onAnyPress = callback; } // New method + + // State getters + bool isPressed() const { return _currentState == _activeState; } + EventType getLastEvent() const { return _lastEvent; } + +private: + enum State { + IDLE, + PRESSED, + RELEASED, + WAITING_FOR_MULTI_CLICK + }; + + uint8_t _pin; + bool _activeState; + bool _isAnalog; + uint16_t _analogThreshold; + + State _state = IDLE; + bool _currentState; + bool _lastState; + + uint32_t _stateChangeTime = 0; + uint32_t _pressTime = 0; + uint32_t _releaseTime = 0; + uint32_t _lastReadTime = 0; + + uint8_t _clickCount = 0; + EventType _lastEvent = NONE; + + // Callbacks + EventCallback _onShortPress = nullptr; + EventCallback _onDoublePress = nullptr; + EventCallback _onTriplePress = nullptr; + EventCallback _onLongPress = nullptr; + EventCallback _onAnyPress = nullptr; + + bool readButton(); + void handleStateChange(); + void triggerEvent(EventType event); +}; \ No newline at end of file diff --git a/examples/companion_radio/UITask.cpp b/examples/companion_radio/UITask.cpp index 675972dc..15897fa2 100644 --- a/examples/companion_radio/UITask.cpp +++ b/examples/companion_radio/UITask.cpp @@ -57,6 +57,24 @@ void UITask::begin(DisplayDriver* display, NodePrefs* node_prefs, const char* bu #ifdef PIN_BUZZER buzzer.begin(); #endif + + // Initialize button with appropriate configuration +#if defined(PIN_USER_BTN) || defined(PIN_USER_BTN_ANA) + #ifdef PIN_USER_BTN + _userButton = new Button(PIN_USER_BTN, USER_BTN_PRESSED); + #else + _userButton = new Button(PIN_USER_BTN_ANA, USER_BTN_PRESSED, true, 20); + #endif + + _userButton->begin(); + + // Set up button callbacks + _userButton->onShortPress([this]() { handleButtonShortPress(); }); + _userButton->onDoublePress([this]() { handleButtonDoublePress(); }); + _userButton->onTriplePress([this]() { handleButtonTriplePress(); }); + _userButton->onLongPress([this]() { handleButtonLongPress(); }); + _userButton->onAnyPress([this]() { handleButtonAnyPress(); }); +#endif } void UITask::soundBuzzer(UIEventType bet) { @@ -233,53 +251,8 @@ void UITask::userLedHandler() { #endif } -void UITask::buttonHandler() { - #if defined(PIN_USER_BTN) || defined(PIN_USER_BTN_ANA) - static int prev_btn_state = !USER_BTN_PRESSED; - static int prev_btn_state_ana = !USER_BTN_PRESSED; - static unsigned long btn_state_change_time = 0; - static unsigned long next_read = 0; - int cur_time = millis(); - if (cur_time >= next_read) { - int btn_state = 0; - int btn_state_ana = 0; - #ifdef PIN_USER_BTN - btn_state = digitalRead(PIN_USER_BTN); - #endif - #ifdef PIN_USER_BTN_ANA - btn_state_ana = (analogRead(PIN_USER_BTN_ANA) < 20); // analogRead returns a value hopefully below 20 when button is pressed. - #endif - if (btn_state != prev_btn_state || btn_state_ana != prev_btn_state_ana) { // check for either digital or analogue button change of state - if (btn_state == USER_BTN_PRESSED || btn_state_ana == USER_BTN_PRESSED) { // pressed? - if (_display != NULL) { - if (_display->isOn()) { - clearMsgPreview(); - } else { - _display->turnOn(); - _need_refresh = true; - } - _auto_off = cur_time + AUTO_OFF_MILLIS; // extend auto-off timer - } - } else { // unpressed ? check pressed time ... - if ((cur_time - btn_state_change_time) > 5000) { - #ifdef PIN_STATUS_LED - digitalWrite(PIN_STATUS_LED, LOW); - delay(10); - #endif - shutdown(); // without restart - } - } - btn_state_change_time = millis(); - prev_btn_state = btn_state; - prev_btn_state_ana = btn_state_ana; - } - next_read = millis() + 100; // 10 reads per second - } - #endif - } - - -/* hardware-agnostic pre-shutdown activity should be done here +/* + hardware-agnostic pre-shutdown activity should be done here */ void UITask::shutdown(bool restart){ @@ -303,7 +276,11 @@ void UITask::shutdown(bool restart){ } void UITask::loop() { - buttonHandler(); + #if defined(PIN_USER_BTN) || defined(PIN_USER_BTN_ANA) + if (_userButton) { + _userButton->update(); + } + #endif userLedHandler(); #ifdef PIN_BUZZER @@ -328,3 +305,48 @@ void UITask::loop() { } } } + +void UITask::handleButtonAnyPress() { + MESH_DEBUG_PRINTLN("UITask: any press triggered"); + if (_display != NULL) { + if (!_display->isOn()) { + _display->turnOn(); + _need_refresh = true; + } else { + // Turn on display + _display->turnOn(); + _need_refresh = true; + } + _auto_off = millis() + AUTO_OFF_MILLIS; // extend auto-off timer + } +} + +void UITask::handleButtonShortPress() { + MESH_DEBUG_PRINTLN("UITask: short press triggered"); + if (_display != NULL) { + if (_display->isOn()) { + // If display is on and showing message preview, clear it + if (_origin[0] && _msg[0]) { + clearMsgPreview(); + } + } + } +} + +void UITask::handleButtonDoublePress() { + MESH_DEBUG_PRINTLN("UITask: double press triggered"); + // Not implemented. TODO: possibly send an advert here? +} + +void UITask::handleButtonTriplePress() { + MESH_DEBUG_PRINTLN("UITask: triple press triggered"); + // Toggle buzzer quiet mode + #ifdef PIN_BUZZER + buzzer.quiet(!buzzer.isQuiet()); + #endif +} + +void UITask::handleButtonLongPress() { + MESH_DEBUG_PRINTLN("UITask: long press triggered"); + shutdown(); +} \ No newline at end of file diff --git a/examples/companion_radio/UITask.h b/examples/companion_radio/UITask.h index d774e54c..a4bf6103 100644 --- a/examples/companion_radio/UITask.h +++ b/examples/companion_radio/UITask.h @@ -9,6 +9,7 @@ #endif #include "NodePrefs.h" +#include "Button.h" enum class UIEventType { @@ -35,10 +36,22 @@ class UITask { int _msgcount; bool _need_refresh = true; + // Button handlers +#if defined(PIN_USER_BTN) || defined(PIN_USER_BTN_ANA) + Button* _userButton = nullptr; +#endif + void renderCurrScreen(); - void buttonHandler(); void userLedHandler(); void renderBatteryIndicator(uint16_t batteryMilliVolts); + + // Button action handlers + void handleButtonAnyPress(); + void handleButtonShortPress(); + void handleButtonDoublePress(); + void handleButtonTriplePress(); + void handleButtonLongPress(); + public: From ce87156a435d1e4c6fefd94fc32bd0d381da4d82 Mon Sep 17 00:00:00 2001 From: JQ Date: Wed, 28 May 2025 16:45:41 -0700 Subject: [PATCH 2/7] cleanup --- examples/companion_radio/Button.cpp | 1 + examples/companion_radio/Button.h | 2 +- examples/companion_radio/UITask.cpp | 6 +----- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/examples/companion_radio/Button.cpp b/examples/companion_radio/Button.cpp index 161bb6aa..09172404 100644 --- a/examples/companion_radio/Button.cpp +++ b/examples/companion_radio/Button.cpp @@ -97,6 +97,7 @@ void Button::handleStateChange() { } else { // Long press already handled in update() _state = IDLE; + _clickCount = 0; // Reset click count after long press } } } diff --git a/examples/companion_radio/Button.h b/examples/companion_radio/Button.h index a7406824..74e5b3f7 100644 --- a/examples/companion_radio/Button.h +++ b/examples/companion_radio/Button.h @@ -5,7 +5,7 @@ // Button timing configuration #define BUTTON_DEBOUNCE_TIME_MS 50 // Debounce time in ms -#define BUTTON_CLICK_TIMEOUT_MS 400 // Max time between clicks for multi-click +#define BUTTON_CLICK_TIMEOUT_MS 500 // Max time between clicks for multi-click #define BUTTON_LONG_PRESS_TIME_MS 5000 // Time to trigger long press (5 seconds) #define BUTTON_READ_INTERVAL_MS 10 // How often to read the button diff --git a/examples/companion_radio/UITask.cpp b/examples/companion_radio/UITask.cpp index 15897fa2..7b2a6c52 100644 --- a/examples/companion_radio/UITask.cpp +++ b/examples/companion_radio/UITask.cpp @@ -311,12 +311,8 @@ void UITask::handleButtonAnyPress() { if (_display != NULL) { if (!_display->isOn()) { _display->turnOn(); - _need_refresh = true; - } else { - // Turn on display - _display->turnOn(); - _need_refresh = true; } + _need_refresh = true; _auto_off = millis() + AUTO_OFF_MILLIS; // extend auto-off timer } } From db8e72791c5b9397b65a1b673e6edd46446048f8 Mon Sep 17 00:00:00 2001 From: JQ Date: Fri, 30 May 2025 20:32:49 -0700 Subject: [PATCH 3/7] usability fixes, fix t114 build src filter --- examples/companion_radio/Button.cpp | 6 +++--- examples/companion_radio/Button.h | 4 ++-- examples/companion_radio/UITask.cpp | 15 +++++++++++---- examples/companion_radio/UITask.h | 1 + variants/t114/platformio.ini | 3 +-- 5 files changed, 18 insertions(+), 11 deletions(-) diff --git a/examples/companion_radio/Button.cpp b/examples/companion_radio/Button.cpp index 09172404..00ae39ff 100644 --- a/examples/companion_radio/Button.cpp +++ b/examples/companion_radio/Button.cpp @@ -60,10 +60,10 @@ void Button::update() { _state = IDLE; } - // Handle long press + // Handle long press while button is held if (_state == PRESSED && (now - _pressTime) > BUTTON_LONG_PRESS_TIME_MS) { triggerEvent(LONG_PRESS); - _state = IDLE; // Prevent multiple long press events + _state = IDLE; // Prevent multiple press events _clickCount = 0; } } @@ -97,7 +97,7 @@ void Button::handleStateChange() { } else { // Long press already handled in update() _state = IDLE; - _clickCount = 0; // Reset click count after long press + _clickCount = 0; } } } diff --git a/examples/companion_radio/Button.h b/examples/companion_radio/Button.h index 74e5b3f7..82e953ab 100644 --- a/examples/companion_radio/Button.h +++ b/examples/companion_radio/Button.h @@ -6,7 +6,7 @@ // Button timing configuration #define BUTTON_DEBOUNCE_TIME_MS 50 // Debounce time in ms #define BUTTON_CLICK_TIMEOUT_MS 500 // Max time between clicks for multi-click -#define BUTTON_LONG_PRESS_TIME_MS 5000 // Time to trigger long press (5 seconds) +#define BUTTON_LONG_PRESS_TIME_MS 3000 // Time to trigger long press (3 seconds) #define BUTTON_READ_INTERVAL_MS 10 // How often to read the button class Button { @@ -33,7 +33,7 @@ public: void onDoublePress(EventCallback callback) { _onDoublePress = callback; } void onTriplePress(EventCallback callback) { _onTriplePress = callback; } void onLongPress(EventCallback callback) { _onLongPress = callback; } - void onAnyPress(EventCallback callback) { _onAnyPress = callback; } // New method + void onAnyPress(EventCallback callback) { _onAnyPress = callback; } // State getters bool isPressed() const { return _currentState == _activeState; } diff --git a/examples/companion_radio/UITask.cpp b/examples/companion_radio/UITask.cpp index 7b2a6c52..39364e42 100644 --- a/examples/companion_radio/UITask.cpp +++ b/examples/companion_radio/UITask.cpp @@ -308,11 +308,13 @@ void UITask::loop() { void UITask::handleButtonAnyPress() { MESH_DEBUG_PRINTLN("UITask: any press triggered"); + // called on any button press before other events, to wake up the display quickly + // do not refresh the display here, as it may block the button handler if (_display != NULL) { - if (!_display->isOn()) { + _displayWasOn = _display->isOn(); // Track display state before any action + if (!_displayWasOn) { _display->turnOn(); } - _need_refresh = true; _auto_off = millis() + AUTO_OFF_MILLIS; // extend auto-off timer } } @@ -320,12 +322,17 @@ void UITask::handleButtonAnyPress() { void UITask::handleButtonShortPress() { MESH_DEBUG_PRINTLN("UITask: short press triggered"); if (_display != NULL) { - if (_display->isOn()) { - // If display is on and showing message preview, clear it + // Only clear message preview if display was already on before button press + if (_displayWasOn) { + // If display was on and showing message preview, clear it if (_origin[0] && _msg[0]) { clearMsgPreview(); + } else { + // Otherwise, refresh the display + _need_refresh = true; } } + // Note: Display turn-on and auto-off timer extension are handled by handleButtonAnyPress } } diff --git a/examples/companion_radio/UITask.h b/examples/companion_radio/UITask.h index a4bf6103..9546aaf0 100644 --- a/examples/companion_radio/UITask.h +++ b/examples/companion_radio/UITask.h @@ -35,6 +35,7 @@ class UITask { char _msg[80]; int _msgcount; bool _need_refresh = true; + bool _displayWasOn = false; // Track display state before button press // Button handlers #if defined(PIN_USER_BTN) || defined(PIN_USER_BTN_ANA) diff --git a/variants/t114/platformio.ini b/variants/t114/platformio.ini index 9e72bbd6..37e31e6f 100644 --- a/variants/t114/platformio.ini +++ b/variants/t114/platformio.ini @@ -79,8 +79,7 @@ build_flags = build_src_filter = ${Heltec_t114.build_src_filter} + + - +<../examples/companion_radio/main.cpp> - +<../examples/companion_radio/UITask.cpp> + +<../examples/companion_radio> + + + From c445bbeaf250792cbdce943c9f76afb08d3da32a Mon Sep 17 00:00:00 2001 From: JQ Date: Fri, 30 May 2025 22:14:37 -0700 Subject: [PATCH 4/7] simplify logic --- examples/companion_radio/Button.cpp | 10 +++++----- examples/companion_radio/Button.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/companion_radio/Button.cpp b/examples/companion_radio/Button.cpp index 00ae39ff..0e425b9a 100644 --- a/examples/companion_radio/Button.cpp +++ b/examples/companion_radio/Button.cpp @@ -2,13 +2,13 @@ Button::Button(uint8_t pin, bool activeState) : _pin(pin), _activeState(activeState), _isAnalog(false), _analogThreshold(20) { - _currentState = !_activeState; + _currentState = false; // Initialize as not pressed _lastState = _currentState; } Button::Button(uint8_t pin, bool activeState, bool isAnalog, uint16_t analogThreshold) : _pin(pin), _activeState(activeState), _isAnalog(isAnalog), _analogThreshold(analogThreshold) { - _currentState = !_activeState; + _currentState = false; // Initialize as not pressed _lastState = _currentState; } @@ -70,16 +70,16 @@ void Button::update() { bool Button::readButton() { if (_isAnalog) { - return (analogRead(_pin) < _analogThreshold) ? _activeState : !_activeState; + return (analogRead(_pin) < _analogThreshold); } else { - return digitalRead(_pin); + return (digitalRead(_pin) == _activeState); } } void Button::handleStateChange() { uint32_t now = millis(); - if (_currentState == _activeState) { + if (_currentState) { // Button pressed _pressTime = now; _state = PRESSED; diff --git a/examples/companion_radio/Button.h b/examples/companion_radio/Button.h index 82e953ab..47c792bd 100644 --- a/examples/companion_radio/Button.h +++ b/examples/companion_radio/Button.h @@ -36,7 +36,7 @@ public: void onAnyPress(EventCallback callback) { _onAnyPress = callback; } // State getters - bool isPressed() const { return _currentState == _activeState; } + bool isPressed() const { return _currentState; } EventType getLastEvent() const { return _lastEvent; } private: From f69efaf027ac997fdb91f0de61ea76c0eb5ba90c Mon Sep 17 00:00:00 2001 From: JQ Date: Fri, 30 May 2025 22:26:29 -0700 Subject: [PATCH 5/7] removing pinmode --- examples/companion_radio/Button.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/examples/companion_radio/Button.cpp b/examples/companion_radio/Button.cpp index 0e425b9a..ec1f0f69 100644 --- a/examples/companion_radio/Button.cpp +++ b/examples/companion_radio/Button.cpp @@ -13,9 +13,6 @@ Button::Button(uint8_t pin, bool activeState, bool isAnalog, uint16_t analogThre } void Button::begin() { - if (!_isAnalog) { - pinMode(_pin, INPUT_PULLUP); - } _currentState = readButton(); _lastState = _currentState; } From cf171af72ca1ef662135d21fd86aa59bdaeb417a Mon Sep 17 00:00:00 2001 From: JQ Date: Fri, 30 May 2025 22:55:53 -0700 Subject: [PATCH 6/7] add ack for quiet mode --- examples/companion_radio/UITask.cpp | 11 ++++++++++- examples/companion_radio/UITask.h | 3 ++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/examples/companion_radio/UITask.cpp b/examples/companion_radio/UITask.cpp index 39364e42..b2142a4d 100644 --- a/examples/companion_radio/UITask.cpp +++ b/examples/companion_radio/UITask.cpp @@ -87,6 +87,9 @@ switch(bet){ case UIEventType::channelMessage: buzzer.play("kerplop:d=16,o=6,b=120:32g#,32c#"); break; + case UIEventType::ack: + buzzer.play("ack:d=32,o=7,b=120:c"); + break; case UIEventType::roomMessage: case UIEventType::newContactMessage: case UIEventType::none: @@ -345,7 +348,13 @@ void UITask::handleButtonTriplePress() { MESH_DEBUG_PRINTLN("UITask: triple press triggered"); // Toggle buzzer quiet mode #ifdef PIN_BUZZER - buzzer.quiet(!buzzer.isQuiet()); + if (buzzer.isQuiet()) { + buzzer.quiet(false); + soundBuzzer(UIEventType::ack); + } else { + soundBuzzer(UIEventType::ack); + buzzer.quiet(true); + } #endif } diff --git a/examples/companion_radio/UITask.h b/examples/companion_radio/UITask.h index 9546aaf0..acf5237e 100644 --- a/examples/companion_radio/UITask.h +++ b/examples/companion_radio/UITask.h @@ -17,7 +17,8 @@ contactMessage, channelMessage, roomMessage, - newContactMessage + newContactMessage, + ack }; class UITask { From 4ec3675091c1285825fe7f330174761e076c4025 Mon Sep 17 00:00:00 2001 From: JQ Date: Fri, 30 May 2025 22:58:30 -0700 Subject: [PATCH 7/7] update sound --- examples/companion_radio/UITask.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/companion_radio/UITask.cpp b/examples/companion_radio/UITask.cpp index b2142a4d..5ff5f140 100644 --- a/examples/companion_radio/UITask.cpp +++ b/examples/companion_radio/UITask.cpp @@ -88,7 +88,7 @@ switch(bet){ buzzer.play("kerplop:d=16,o=6,b=120:32g#,32c#"); break; case UIEventType::ack: - buzzer.play("ack:d=32,o=7,b=120:c"); + buzzer.play("ack:d=32,o=8,b=120:c"); break; case UIEventType::roomMessage: case UIEventType::newContactMessage: