Fix setFade, Make MASSAGE-mode work again (pre-rework)

MASSAGE mode is now useable again for now.
(no more random driving and unexpected shaking)
A full rework is still planned.

- Fix setFade method (did not change anything when not writing to nvs)

- joystick/massage:
    - reverse motor direction every 2nd cycle to preving driving
    - simplify modes (now only FW/REV and LEFT/RIGHT)
    - use joystick angle to vary the duty cycle
    - optimize delay and duty calculation (min max config)
    - drop hysteresis (not much use, just much code)
This commit is contained in:
jonny_l480
2024-06-01 17:59:29 +02:00
parent 5fe970f60b
commit 32b31b481d
3 changed files with 50 additions and 68 deletions

View File

@@ -543,7 +543,7 @@ void controlledArmchair::changeMode(controlMode_t modeNew)
case controlMode_t::MASSAGE:
ESP_LOGW(TAG, "switching to MASSAGE mode -> reducing fading");
uint32_t shake_msFadeAccel = 200; // TODO: move this to config
uint32_t shake_msFadeAccel = 350; // TODO: move this to config
uint32_t shake_msFadeDecel = 0; // TODO: move this to config
// save currently set normal acceleration config (for restore when leavinge MASSAGE again)