12 Commits

Author SHA1 Message Date
jonny_l480
be40a8c2d3 Rework fan control: single pin, more delay, config
- 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
2023-08-15 19:39:37 +02:00
jonny_l480
3f73344b93 Update config with new pin assignment
- apply changed pins to config (according to new hardware configuration)
- calibrate joystick, more tolerance
2023-08-14 23:54:12 +02:00
jonny_l480
73ad36bb2d Update joystick config, Add option JOYSTICK_LOG_IN_IDLE
- 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
2023-05-27 11:11:13 +02:00
jonny_ji7
f8415655c2 Create class 'automatedArmchair', Add AUTO mode
- 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)
2022-08-10 22:01:50 +02:00
jonny_ji7
06d0fda8ee Create httpJoystick class
create new class for http mode -> move code for http mode from control.cpp to http.cpp
this makes control.cpp and config.cpp more clear
2022-06-22 12:29:08 +02:00
jonny_ji7
ad2dbb0ce0 Create class controlledFan, Add getStatus to motorctl
- 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
2022-06-11 16:47:13 +02:00
jonny_ji7
5e2962302d Move control to class, Add toggleIdle, toggleModes
- 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
2022-06-11 13:07:42 +02:00
jonny_ji7
06451b47d0 Add 'buzzer.hpp, buzzer.cpp' Add instance 'button'
- 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
2022-06-10 08:40:46 +02:00
jonny_ji7
fb90169fa4 Add evaluatedSwitch component, Add buttonJoystick
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
2022-06-10 08:30:07 +02:00
jonny_ji7
4109c6f239 Add 'motorRight' instance and configuration 2022-06-09 12:05:27 +02:00
jonny_ji7
4eb1c5d43a Create class 'evaluatedJoystick'
- 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
2022-06-08 19:50:17 +02:00
jonny_ji7
84bfe211ac Create class 'controlledMotor', Create config
- 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.
2022-06-05 16:36:57 +02:00