2 questions regarding joysticks

We have decided to not use the Attack 3 joystick and we are now going to use 1 Saitek controller. Because of this switch, I have two questions.

  1. Is there a way to read POV using the Get Joystick VIs. If not, the POV also counts as buttons 12 through 20, but I would prefer not to have 8 case structures and just read the direction from the POV. I know that LabVIEW has a connectivity VI that allows the reading of POV, but it does not work with a cRIO.

  2. What is the differance between a joystick ‘get’ vi and a joystick ‘get raw’ vi. Should I use the get raw if I am not using the Attack 3 controllers?

  1. I believe the POV is returned as two of the axes. It will only return values that are multiples of 45 degrees.

  2. Get returns a -1 to 1 range, raw returns integers between -128 and 127. Feel free to look at the code of both to see the differences.

Greg McKaskle

The FRC Driver Station only communicates the state of joystick buttons 1-12.

I am sorry to say that I can not answer your first question, I am unsure of what you are asking. But for the second, Get Raw gives you data such as whether a button is pressed or the axis value of the joystick. Get Joystick is rather unclear to me. For button operations use this diagram.
Use Get Raw and feed it to an ‘Unbundle by Name’ then you can use the boolean values that tunnel from the array to use as qualifiers for While loops or Case Structure i.e While (Button 9 == T) or If(Button 7 ==T)
Good luck!

To fix the number of buttons issue, couldn’t I change the input cluster as shown in the attached picture of the joystickrawvalue.vi ?

And the Joystick we plan to use has a scale of 32470 to -32470. So wouldn’t Get Raw give me those numbers and i just have to divide the output by 32470?





The DS protocol returns a byte per axis, so that is what raw refers to. The DS scales all HID joystick axes to the same byte range.

Greg McKaskle

So then no additional coding is necessary for the new joystick and it is programmed the same as an Attack 3 joystick correct?

Yes, any USB device that identifies itself as a “joystick” can be read by the Driver Station.

What’s the verdict on the POV thing? We were just wondering about that today. I’ll try probing some of the other axes tomorrow.

If that doesn’t work, who wants an offseason project to figure out how to get it without using the WPI library?

For us, the POV came up as axis 5 and 6. X on the POV was axis 5 with -1 being left, 0 being center, and 1 being right. Y was axis 6 with -1 being up, 0 being center, and 1 being down.