Log in

View Full Version : Programming Logitech Joystick--how to access right thumbstick?


kittylan
20-01-2013, 19:39
Hi, we are trying to program the Logitech joystick

However, the methods stick.GetX or stick.GetY only access the left thumbstick--we cannot retrieve the values for the right thumbstick. (FYI, thumbsticks are the twirling little sticks on the game controller...):ahh: ::rtm::

How do we use the Get methods to find values for the second thumbstick? Our team is hoping to use tankdrive this year... Thanks!::safety:: :)

BigJ
20-01-2013, 19:44
You'll need to use getRawAxis (http://team2168.org/javadoc/edu/wpi/first/wpilibj/Joystick.html#getRawAxis(int)) to access the other axes of the stick. I don't know the exact mapping of your gamepad so you'll ant to use a dashboard or console output to find out the axes you need to use.

mprasolov
21-01-2013, 02:45
You can find the axes (if you're using Windows) by going into Control Panel, Devices and Printers, and right-click on the Joystick. Then, go into properties and you should see the info there. If you can't see some data, begin a calibration and look at the data there, just cancel before it saves the calibration profile.

If there are only 3 axes, you can just use stick.GetZ too, unless you have more than that. In that case, follow kittylan's instruction.

Hope this helps!