-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add analogoutput and simulated ABS effect #9
Conversation
and analog output and simulated ABS trigger current simulated abs trigger was set to 80%, will add a slider to simhub to control
add check box for simulated ABS trigger also add trigger to DAP config Reading config when connect to pedal
add comment to #define using_analog_output default was BLE connection
add trigger value for simulated ABS
add slider for trigger of simulated ABS
add arduino code instruction
add arduino code instruction
Arduino/Esp32/Main/Main.ino
Outdated
@@ -685,7 +685,7 @@ void pedalUpdateTask( void * pvParameters ) | |||
} | |||
if(dap_config_st.payLoadPedalConfig_.Simulate_ABS_trigger==1) | |||
{ | |||
if(joystickNormalizedToInt32>8000) | |||
if(joystickNormalizedToInt32>dap_config_st.payLoadPedalConfig_.Simulate_ABS_value*100) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An uint8 value is multiplied by 100. Thats potentially dangerous as it could lead to overflow. Could you please add an int32 cast here, e.g.:
((int32)dap_config_st.payLoadPedalConfig_.Simulate_ABS_value) * 100
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure! thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome. Since a field to the config structure was added, please increment the revision DAP_VERSION_CONFIG to 109 in the arduino and plugin code
Arduino code:
#define DAP_VERSION_CONFIG 108 |
Plugin code:
dap_config_initial_st.payloadHeader_.version = 108; |
public uint pedalConfigPayload_version = 108; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all done! many thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the more interactive canvas control, the vertical sliders can be removed and the rectangle positions have to be updated when the config is received from the pedal:
You would do me a favour by implementing the aforementioned changes.
I think the config from pedal will auto update.
will hide those slide first, when I have time, will clean the code then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the force vs travel slider code clean up already done
ABS trigger value change type to int32
control by canvas add rectangles on canvas to control AP travel vs force
fix a graphic issue when data was <5 or>95, the value will incorrect
config version bump to 109
config version bump tp 109. graphic issue fix
hidden force_travel control slider
Slider code cleanup also bug fixed.
add analog output for SC D15 port
add simulated ABS effect, so modified the dap_config structure.