auto.cpp:
apply fadeAccel and fadeDecel from commands to motors
main.cpp:
double stack size of button task (crashed controller every time)
button.cpp:
Modify test command to actually eject armchair leg support
control.cpp:
apply generated motor commands to motors
rename some variables:
typo: fadeAccel
more specific: auto_instruction_t
- automaticArmchair:
- add method addCommands for adding an array of
commands to queue
- add keys to simpleCommand struct
- fadeDecel (not used yet)
- fadeAcel (not used yet)
- instructions (new enum for running other commands in control task
, not used yet)
- button.cpp
- add example command to 1x button press (comment out previous cmd
temporarily)
- control.cpp
- update changeMode function: dont do anything when current mode is
already target mode
New command and feature also made some general changes to control and button necessary
joystick.cpp:
- add optional parameter to joystick_CommandsDriving function
bool altStickMapping (default false)
if true this currently swaps BOTTOM_LEFT with BOTTOM_RIGHT for experimental
different joystick mapping
button.cpp:
- fix/move variable declaration outside of switch
- add 12x case: send count to control task
control.cpp:
- create new section in handle loop for button events
- move x1 commands from JOYSTICK and MASSAGE case to new button
section
- remove unnecessary variable buttonEvent (only using buttonCount now)
- add functionality to 12x button event -> toggle alternative stick
mapping
readme.md:
- add new x12 button command
button.cpp:
- Add command: reboot when long button press
- Add command: switch to mode JOYSTICK with 3x press
Readme:
- rework table with switch functions
- add new commands to table
- add drink holder to planned features
joystick.cpp:
- fix bug: missing 'break;' for switch case in function joystick_CommandsShaking
- add 3 functions to controlledMotor class in motorctl.cpp/hpp
- setFade: set specific msFade duration for acceleration or
deceleration
- setFade: disable or set to default ramp for acceleration or
deceleration
- toggleFade: toggle between fading enabled or disables for
acceleration or deceleration
- button.cpp
- add controlledMotor objects to constructor
- add new command 8x press which now toggles fade-deceleration of both
motors
- config.cpp
- slightly decrease fading durations
- Create http.cpp and http.hpp
- functions for initializing a http server
- function for URL api/joystick
- receive joystick data from http post request
- parse json, define joystick position (function from joystick.hpp)
- send data to control task via queue
- control.hpp/cpp:
- add HTTP mode to handle loop
- receive joystick commands from queue, generate commands, send to
motorctl
- upgrade changeMode function with ability to run functions at switch
FROM and TO certain modes
- add code to start/stop wifi and webserver when switching to/from
HTTP mode
- change toggleModes and toggleIdle to use the changeMode function
- main.cpp:
- add several sections with code for testing new functions (commented
out)
- add http loglevel
- buzzer.cpp:
- add command (press 4 times) to toggle between HTTP and JOYSTICK mode
FIXME: moved initialization of wifi to main.cpp at startup because of an
error -> resolve this and place wifi start and stop functions into
mode-change as intended
currently works best in accesspoint mode with laptop connected using the
react-webapp
- Move all separately declared functions in control.hpp to a new class
'controlledArmchair'
- now passing other objects only one time with constructor instead
of accessing them globally
- Create control instance in config.hpp, and passing objects in
config.cpp
- Add functions to new control class
- toggleIdle(): toggle between last mode and idle
- toggleModes(mode1, mode2): toggle between two modes
- Add commands to button.cpp
- 2x button press: call toggleIdle()
- 6x button press: toggleModes MASSAGE -> JOYSTICK
- Define control task in main.cpp
- Adjust button files and main.cpp to use the new command object instead
of the previus functions
Add control.hpp and control.cpp
- task that repeatedly generates motor commands depending on the current mode
- function to change to a specified control mode
Add button.hpp and button.cpp
- class which runs commands depending on the count a button was pressed
Update main.cpp
- create button task
- create control task
- comment out previous testing code
- remove unnecessary includes (already included in config.hpp)
Add control.cpp and button.cpp to CMakeLists
Notes: Tested this state on the armchair: All currently implemented features
work. You can switch between IDLE and JOYSTICK by pressing the button 2
or 3 times. Also driving works well (limited to 60% duty, with no fans
yet).