Adjust beeping
Tested on actual hardware. - adjust count and duration of beeps
This commit is contained in:
parent
cdfa64fbc0
commit
0672d08cb8
@ -67,7 +67,7 @@ void buttonCommands::action (uint8_t count, bool lastPressLong){
|
||||
// ## no command ##
|
||||
default:
|
||||
ESP_LOGE(TAG, "no command for count=%d and long=%d defined", count, lastPressLong);
|
||||
buzzer->beep(3, 400, 100);
|
||||
buzzer->beep(3, 200, 100);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
@ -76,7 +76,7 @@ void buttonCommands::action (uint8_t count, bool lastPressLong){
|
||||
{
|
||||
control->changeMode(controlMode_t::MENU);
|
||||
ESP_LOGW(TAG, "1x long press -> change to menu mode");
|
||||
buzzer->beep(1, 1000, 1);
|
||||
buzzer->beep(20, 20, 10);
|
||||
vTaskDelay(500 / portTICK_PERIOD_MS);
|
||||
}
|
||||
// ## toggle joystick freeze ##
|
||||
@ -214,4 +214,4 @@ void buttonCommands::startHandleLoop()
|
||||
}
|
||||
} //end queue
|
||||
} //end while(1)
|
||||
} //end function
|
||||
} //end function
|
||||
|
@ -419,7 +419,7 @@ void controlledArmchair::changeMode(controlMode_t modeNew) {
|
||||
break;
|
||||
|
||||
case controlMode_t::IDLE:
|
||||
buzzer->beep(1, 1500, 0);
|
||||
buzzer->beep(1, 1000, 0);
|
||||
#ifdef JOYSTICK_LOG_IN_IDLE
|
||||
esp_log_level_set("evaluatedJoystick", ESP_LOG_DEBUG);
|
||||
#endif
|
||||
|
@ -159,8 +159,8 @@ void createObjects()
|
||||
httpJoystickMain = new httpJoystick(configHttpJoystickMain);
|
||||
http_init_server(on_joystick_url);
|
||||
|
||||
// create buzzer object on pin 12 with gap between queued events of 100ms
|
||||
buzzer = new buzzer_t(GPIO_NUM_12, 100);
|
||||
// create buzzer object on pin 12 with gap between queued events of 1ms
|
||||
buzzer = new buzzer_t(GPIO_NUM_12, 1);
|
||||
|
||||
// create objects for controlling the chair position
|
||||
// gpio_up, gpio_down, name
|
||||
|
@ -222,6 +222,7 @@ void item_debugJoystick_action(display_task_parameters_t * objects, SSD1306_t *
|
||||
case RE_ET_BTN_CLICKED:
|
||||
case RE_ET_BTN_LONG_PRESSED:
|
||||
running = false;
|
||||
objects->buzzer->beep(1, 100, 10);
|
||||
break;
|
||||
case RE_ET_CHANGED:
|
||||
case RE_ET_BTN_PRESSED:
|
||||
@ -586,19 +587,24 @@ void handleMenu(display_task_parameters_t * objects, SSD1306_t *display)
|
||||
{
|
||||
case RE_ET_CHANGED:
|
||||
//--- scroll in list ---
|
||||
objects->buzzer->beep(1, 10, 5);
|
||||
if (event.diff < 0)
|
||||
{
|
||||
if (selectedItem != itemCount - 1)
|
||||
{
|
||||
objects->buzzer->beep(1, 20, 0);
|
||||
selectedItem++;
|
||||
ESP_LOGD(TAG, "showing next item: %d '%s'", selectedItem, menuItems[selectedItem].title);
|
||||
ESP_LOGD(TAG, "showing next item: %d '%s'", selectedItem, menuItems[selectedItem].title);
|
||||
}
|
||||
//note: display will update at start of next run
|
||||
}
|
||||
else
|
||||
{
|
||||
if (selectedItem != 0)
|
||||
{
|
||||
objects->buzzer->beep(1, 20, 0);
|
||||
selectedItem--;
|
||||
ESP_LOGD(TAG, "showing previous item: %d '%s'", selectedItem, menuItems[selectedItem].title);
|
||||
ESP_LOGD(TAG, "showing previous item: %d '%s'", selectedItem, menuItems[selectedItem].title);
|
||||
}
|
||||
//note: display will update at start of next run
|
||||
}
|
||||
break;
|
||||
@ -623,7 +629,7 @@ void handleMenu(display_task_parameters_t * objects, SSD1306_t *display)
|
||||
case RE_ET_BTN_LONG_PRESSED:
|
||||
//--- exit menu mode ---
|
||||
// change to previous mode (e.g. JOYSTICK)
|
||||
objects->buzzer->beep(4, 15, 5);
|
||||
objects->buzzer->beep(12, 15, 8);
|
||||
objects->control->toggleMode(controlMode_t::MENU); //currently already in MENU -> changes to previous mode
|
||||
ssd1306_clear_screen(display, false);
|
||||
break;
|
||||
@ -708,4 +714,4 @@ void handleMenu(display_task_parameters_t * objects, SSD1306_t *display)
|
||||
objects->control->changeMode(controlMode_t::IDLE);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ void buzzer_t::processQueue(){
|
||||
// otherwise waits for at least 7 weeks
|
||||
if( xQueueReceive( beepQueue, &entryRead, portMAX_DELAY ) )
|
||||
{
|
||||
ESP_LOGW(TAG_BUZZER, "Read entry from queue: count=%d, msOn=%d, msOff=%d", entryRead.count, entryRead.msOn, entryRead.msOff);
|
||||
ESP_LOGI(TAG_BUZZER, "Read entry from queue: count=%d, msOn=%d, msOff=%d", entryRead.count, entryRead.msOn, entryRead.msOff);
|
||||
|
||||
//beep requested count with requested delays
|
||||
for (int i = entryRead.count; i--;){
|
||||
|
Loading…
x
Reference in New Issue
Block a user