While testing this feature briefly that approach did not appear to be a good idea.
- noticed that the driving with joystick was a little unintuitive/unexpected (maybe just not used to it?)
- BUG that the state does not reset to center when previous state was
X-AXIS? Resulting in the armchair to slightly shake randomly at
joystick center
-> this has to be fixed if this approach is tested again.
This reverts commit b2b12fe5de1e16ea2f25dfa4b0c3ac6845024c71.
modified function
joystickPos_t joystick_evaluatePosition(float x, float y, joystickPos_t* prevPos)
because prevPos has to be stored http.cpp/hpp and joystick.cpp/hpp had
to be updated as well
TODO: add function without hysteresis again?
WIP this has to be tested
- 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