-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(math): Refactor
espp::RangeMapper<>
to have center deadband an…
…d range deadband and remove invert-input. Similar update to `espp::Joystick`. Fixed bug in `espp::Joystick` which introduced non-linearity when configured as a `CIRCULAR` joystick. (#261) * feat(math): Refactor range mapper to have center deadband and range deadband; remove invert-input * feat(joystick): update joystick to have range deadzone that operates on the vector similar to the rangemapper range deadzone. * feat(joystick): update circularization and add test * Refactor joystick to allow the get function to be null and instead to use the .update(raw_x, raw_y) function, and use new protected recalculate(raw_x, raw_y) function in both the update overloads * Fix bug in circular joystick scaling which inadvertently squared the magnitude as opposed to setting the new magnitude * Update joystick example to loop through array of raw values and print out the circular and square joystick outputs for verification * fix(joystick): update doc and add missing storage of range_deadzone * fix doc * doc: update * final doc update
- Loading branch information
Showing
6 changed files
with
375 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
menu "Example Configuration" | ||
|
||
choice EXAMPLE_HARDWARE | ||
prompt "Hardware" | ||
default EXAMPLE_HARDWARE_QTPYPICO | ||
help | ||
Select the hardware to run this example on. | ||
|
||
config EXAMPLE_HARDWARE_QTPYPICO | ||
depends on IDF_TARGET_ESP32 | ||
bool "Qt Py PICO" | ||
|
||
config EXAMPLE_HARDWARE_QTPYS3 | ||
depends on IDF_TARGET_ESP32S3 | ||
bool "Qt Py S3" | ||
|
||
config EXAMPLE_HARDWARE_CUSTOM | ||
bool "Custom" | ||
endchoice | ||
|
||
config EXAMPLE_ADC_UNIT | ||
int "Example ADC Unit" | ||
default 2 if EXAMPLE_HARDWARE_QTPYPICO | ||
default 2 if EXAMPLE_HARDWARE_QTPYS3 | ||
range 1 2 | ||
help | ||
The ADC unit number for the sensor. The ESP32 has two ADC units, | ||
ADC_UNIT_1 and ADC_UNIT_2. Default is ADC UNIT 2. | ||
|
||
config EXAMPLE_ADC_CHANNEL_X | ||
int "Joystick X Axis ADC Channel" | ||
range 0 50 | ||
default 9 if EXAMPLE_HARDWARE_QTPYPICO | ||
default 7 if EXAMPLE_HARDWARE_QTPYS3 | ||
default 0 if EXAMPLE_HARDWARE_CUSTOM | ||
help | ||
ADC Channel for the X axis of the joystick. Default is ADC2 channel | ||
9 (A0) for Qt Py PICO and ADC2 channel 7 (A0) for Qt Py ESP32S3. | ||
|
||
config EXAMPLE_ADC_CHANNEL_Y | ||
int "Joystick Y Axis ADC Channel" | ||
range 0 50 | ||
default 8 if EXAMPLE_HARDWARE_QTPYPICO | ||
default 6 if EXAMPLE_HARDWARE_QTPYS3 | ||
default 1 if EXAMPLE_HARDWARE_CUSTOM | ||
help | ||
ADC Channel for the Y axis of the joystick. Default is ADC2 channel | ||
8 (A1) for Qt Py PICO and ADC2 channel 6 (A1) for Qt Py ESP32S3. | ||
|
||
endmenu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.