hoverboard-firmware-hack
hoverboard-firmware-hack copied to clipboard
analog control fix
steer control from analog bug fix add new style controll "tank mode" forward/reverse from one stick #ifdef CONTROL_ADC_TANKSTYLE
Hi, Thank you for the contribution, but I don't think that will work. Please move the line 205 to 208 in the main.c so that it is only calculated when the "Tank Style" is active. Please also add a commented out define at a useful place in config.h.
And did you test the code? Is there a sample video?
hi, i make changes, code compiled and tested by my friend. i asked him video. of course i missed to add help/description for #define CONTROL_ADC_TANKSTYLE
control forward-backward right-left from one joystick in "tank mode" demo video https://youtu.be/uBMAFsj5K08
Could you rename "CONTROL_ADC_TANKSTYLE"? maybe something like adc, zero or bias would be more clear for me. For me "tank-style" is the default steering method already active.
Likewise, this is not a fix, but an extension (of an ADC offset). Could you please name this accordingly and adjust the code so that the offset can be set in the config.h?
Likewise, this is not a fix, but an extension (of an ADC offset). Could you please name this accordingly and adjust the code so that the offset can be set in the config.h? offset no have affect to reverse command
cmd2 = CLAMP(adc_buffer.l_rx2 - ADC2_MIN, 0, ADC2_MAX) / (ADC2_MAX / 1000.0f); // ADC2 clamp limited output cmd1 (or cmd2) value between 0 and ADC MAX value so cmd cant to be in range from -1000 to 1000
after cmd = cmd -500; range 0-1000 changed to -500 ... +500 so cmd = (cmd -500) * 2; range 0-1000 changed to -1000 ... +1000
@kozinalexey No this is not a fix, the ADC is not supposed to have negative values and the code is not a "out-of-the-box" code for everything, it is a codebase. Most parts in the config.h should be considered as "example" adding more will obfuscate the file even more. Therefore I don't want to merge your pull request, at least not by myself. I will get in touch with @NiklasFauth.
@p-h-a-i-l Thank you for your contributions and I'm sorry that your own pull request is not merged yet, I will review it as well later.
@Jan--Henrik no worries, I know that my pull request is quite large and time is always limited. You also need to decide what your strategy is for this repo: Code to get stuff running as a foundation for others or a constantly evolving codebase with nice but more complex features.
@kozinalexey you might want to rebase my code change proposals, doesn't look nice to have 7 tiny commits without commit message
@p-h-a-i-l im sorry. i did non clone the repository localy, im only using github visual tools for quick fix, githib visual tools have not rebase function