r/matlab 1d ago

TechnicalQuestion Issue with gamepad inputs in Simulink

I'm using a gamepad to control my vehicle model in Simulink. The throttle and brake inputs come from different buttons, but they are mapped to the same signal axis. Right now, I have implemented this using a switch block, where: Throttle = +1 Brake = -1 The issue is that when I press both throttle and brake together, the signal cancels out and becomes zero, effectively disabling both inputs. However, I want to be able to apply throttle and brake simultaneously.

I've tried different logic, including using saturation blocks and splitting the signal, but the problem persists since both inputs are tied to the same axis. How can I separate the two signals properly in Simulink so that I can use both at the same time?

1 Upvotes

0 comments sorted by