First, please forgive my explanation in English, I'm not a native speaker.
In the original remote, I can easily control my RC car forward by pushing back on the throttle button, braking by pushing forward the throttle button, and reverse by moving to the neutral point, then pushing forward the throttle button.
Now, I would like to use Logitech F710 to control my RC car instead of the original remote.
But I want to cancel the reverse function, like if I push forward the joystick, RC car can move forward, then if I pull down the joystick, RC car can brake, but if I push back joystick to the neutral point then pull down, the RC car can stand still.
I know I can configure the ESC to totally cancel the reverse function, but I actually want to keep the reverse function, I just want to use programming to adjust.
here is my code in Arduino IDE.
I use the ROS to publish my joystick signal on the Arduino IDE,
Ros_msg[3] > 3 means joystick push forward ,
Ros_msg[5] > 3 means joystick pull down,
model = 1 means I set RC car is in driving mode.
the ideal situation: If RC car move forward, variable temp will equal to 1, then pull down the joystick, Ros_msg[5] would > 3, then RC car can brake, but unfortunately when Ros_msg[5] > 3, the Ros_msg[3] would not > 3, because Ros_msg[3] and Ros_msg[5] are receiving the same joystick signal, means temp would not equal to 1 when Ros_msg[5] > 3.
How can fix my code to let my RC car move forward and brake, but cancel the reverse function.