Basically, your joysticks are giving you pseudo analog values (they are technically digital by nature, but they simulate a continuum), and you also want your motors to move along the same continuum. Your left and right drive will both go forward if you push forward and backward if you push backward. While the button is NOT pressed, then your left and right joystick movement will affect your left and right drive motors, slowing one side and speeding the other to make you turn. When you press the button, it will mute those inputs and instead control the middle motor, strafing you side to side. The button is boolean, 1 or 0. When it is unpressed, it is 0, and the (1-button) value is equal to 1, meaning the joystick value is left alone, and the middle motor has the input multiplied by zero. When you press the button, (1-button is now 0, muting the side to side input into your left and right motor, and now sending the joystick times a factor of 1 to the middle motor.
you said it slows one side and speeds up the other. but is this going to result in a standard arcade tank drive system?
When the button is NOT pressed, forward and backward on the joystick will be forward and backward of the drive base, and left and right will be a rotation about the center of the drive base. A combination will lead you to drive in an arc, with one side moving slower than the other.
When the button IS pressed, forward and backward on the joystick will be forward and backward of the drive base, and left and right on the joystick will be linear left and right movement of the drive base. A combination will lead you to strafe at an angle roughly equal to the angle you push the joystick.
You can reverse this by swapping the multiplication term so that your left and right motors use the Button, and your middle motor uses (1-Button).
Thank you. This is a big help
You could also consider still using the second stick, then, if you only need one axis on the second stick to move the arm. You might set a special dead zone on that stick. If the value is small or if the arm value is big, you’re not trying to spin, for example, while the other stick is forward-back and side-to-side.
As for the code, at a glance it looks good. I’m really not a fan of (1-vexRT[Btn5D]) and similar being in there, but that doesn’t mean it’s bad. What I don’t like is that you have to hold down a button with presumably the same hand that is using the stick. I far prefer a toggle that is remembered so that that finger gets freed up to do something else.
the thing is i want to keep one joystick available for two options, i might wind up needing the two axis from one. also i cant get deadbands to work. i need help with that