Joystick y-axes numeric value?

What do I put for the numeric value in my index array for the y-axes of my Thrustmaster joysticks? Here is the number diagram:

I am trying to follow this tutorial:

https://wpilib.screenstepslive.com/s/4485/m/13811/l/696081-tank-drive-tutorial
“In my setup, I’ve selected index 1 for my left motors Y-axis control and index 5 as the right motors Y-axis control. You can see the adjustments in LabVIEW in the following image:”

I think you have
0 - x
1 - y
2 - z
3 - For joysticks with a fourth axis
4 and greater ?? (edit: Apparently for the second y and x control. I feel dumb, but we don’t regular use those controllers.)

That example is designed for a joystick controller such as a gamepad that has 2 small sticks that you would push with your thumbs. To use 2 Thrustmaster joysticks you need to open another joystick in Begin on another USB port and call it something else (say “Joystick 1”) and use it in TeleOp like this.

image

Also, keep in mind if you ever want to use buttons on that joystick, subtract 1 from the number of the button in that diagram. This post should help you understand the logic behind the numbering of buttons (and axes). Joystick butons - #5 by Jonathan_L

1 Like

The easiest way to do this is to open up the Driver Station. Click on the USB icon on the left column of icons. Click on your joystick in the menu. Move the joystick and see which green slider bar moves. The first is 0. The rest increment. This will tell you exactly which axis is which. You can use the same method for your buttons.

1 Like