5 Commits

Author SHA1 Message Date
jonny_ji7
20873b4175 Move coordinate scaling from app to controller
- joystick.cpp/hpp:
  - move method scaleCoordinate from joystick class to public function
  - modify scaleCoordinate function to accept float values instead of
    ADC pin, change tolerance parameters to percent instead of absolute
    number
  - change method getData to use the public function now

- control.cpp:
  - use scaleCoordinate function in http mode
  - calculate radius in http mode

- config.cpp
  - adjust tolerance thresholds for joystick to percent

- App.js
  - disable "snap to zero" feature -> just scale joystick output to
    value of -1 to 1
2022-06-19 15:37:42 +02:00
jonny_l480
0165a88f1f Change dutyMax and fade, Add reboot cmd (1x press)
decrease ramp from 3000ms to 900ms (as in old project)
increase max duty from testing 60 to 94
Add reboot command (untested)
2022-06-19 09:34:14 +02:00
jonny_ji7
cc5226647b Move joystick pos-definition to separate function
Move section that defines joystick position enum to a separate function
(outside of joystick class), this makes it usable for other inputs as
well
- create new function joystick_evaluatePosition
- call the new function in joystickgetData (where code was initially)
- change function joystick_generateCommandsDriving to accept joystick
  data struct instead of joystick object as parameter -> makes the
  function usable with other input than hardware joystick too
2022-06-17 10:43:00 +02:00
jonny_ji7
f7ce61c666 Add function 'joystick_generateCommandsDriving'
- add new function to joystick.hpp/cpp
  - reads data from joystick and generates commands for driving in
    "joystick" mode
  - returns struct with commands for both motors

- main.cpp
  - add code for testing the new function
  - enable 5v regulator (needed for pullups AB left motor)
  - add newly created motorRight to handle function

- add new struct with two motorcommands to motorctl.hpp
2022-06-09 21:42:01 +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