went trough all current files:
- remove old comments
- change structure / newlines
- main.cpp: outsource loglevel function
- http.cpp: FIX compiler warnings
currentsensor.hpp
- remove second fan instance since both fans are controlled via one pin
now
- more config options so fans turn on less at short movements
=> less noise and less relay cycles
- add more debug output in joystick getData function
- update joystick config with new min/max values while testing
=> fixed bugged movement (joystick unusable) after winter
- bump esp-idf version since successfully compiled with 4.4.4
- Create class automatedArmchair in new files auto.hpp and auto.cpp
This class currently makes it possible to queue up and run commands
(motorstate, duty for certaion duration),
- add new file to cmakelists
- create automatedArmchair instance 'armchair' in config.cpp
- add loglevel configuration to main.cpp
- add AUTO mode to control.cpp (no way to change to mode yet)
- Add class for controlling fans for cooling the motor drivers
- Add configuration for left and right fan to config.cpp
- Create fan task in main.cpp
- Add getStatus function to controlledMotor class
- 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
- Copy buzzer function from gate project
this makes it possible to easily trigger and queue up buzzing events
without having to worry about delaying the program
- Add instance buzzer to config
- Add code for testing the buzzer to main.cpp
Copy gpio component from gate project
Add instance of evaluatedswitch for button next to joystick to config
Add code for testing the button to main.cpp
- Create class 'evaluatedJoystick'
- evaluates a joystick with 2 analog signals
- scales the adc input to coordinates with detailed tolerances
- calculates angle and radius
- defines an enum with position information
- Add joystick configuration and class instance to config.cpp
- Add code for testing the new class to main.cpp
- Add joystick.cpp to cmakelists
now function `joystick.getData` can be used globally to obtain a struct with
current position data of the joystick
- Create class 'controlledMotor':
- handles 'fading / ramp' of the pwm duty
- handles current limit **not implemented yet**
- has .handle function that is intended to be run very fast in another task
commands are sent via queue
- Create config.hpp
- Globally available instance motorLeft of controlledMotor class
- Create config.cpp
- Configuration of motordriver and control parameters for motorLeft
- Add config.cpp and motorctl.cpp to cmakelists
- main.cpp:
- create 'task_motorctl' which repeatedly runs motorLeft.handle()
- modify testing code for testing the new class
- comments
The fading/ramp capability of the new class was tested successfully
using a breakoutboard with an led.