Require help programming a Z-Axis on a Logitech joystick

Our programming team wants to use the Z-axis on a Logitech joystick as the throttle for our shooter motor. Our problem is that we want the negative portion to be zero and the positive to represent full throttle. Sorry for not being clear - it’s hard to convey what I mean over text. If you need any more details, feel free to ask.

Thanks
-3868
:]

What language are you programming in? If the most positive value is 1 and the most negative value is -1, what I’ve done in the past is added 1 and divided by 2 (to the joystick value). [strike] Also, an exception needs to be put in place when is the value is -1 because -1+1=0/.5 results in potentially undefined behavior (at least in c++). [/strike]

If you are using Labview you could just add one, divide by 2 and if it goes the wrong way, multiply by -1.

There are 2 things wrong with the last sentence above.

  1. Dividing zero by something does not result in undefined behavior. Dividing something by zero does.

  2. 0/.5 is not dividing by 2. It is dividing by 1/2, which is multiplying by 2.