View Single Post
  #4   Spotlight this post!  
Unread 30-01-2012, 23:26
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Logitech Gamepad

This is how common gamepads map to the FRC joystick data bundle:

Logitech DualAction:
All buttons labeled on the gamepad (including 11 and 12) are accessed as their button # - In LabVIEW, you can unbundle the Buttons and pick 11 or 12, in C++ you can do whatever you normally would do to get a button (I don't know exactly what that is)
Axis 1 -> Left X
Axis 2 -> Left Y
Axis 3 -> Right X
Axis 3 -> Right Y
Axis 5 -> D-Pad X (this is binary - +-1 is left/right)
Axis 6 -> D-Pad Y (binary also)

Logitech F310 or Xbox 360 is slightly different:
-Buttons 1-8 are used. They are not labeled, you can try reading all 8 and seeing what maps to what. I know that 9-12 are not used.
Axis 1 -> Left X
Axis 2 -> Left Y
Axis 3 -> Sum of L2 and R2 analog triggers - One is positive, the other is negative, both or neither is 0.
Axis 4 -> Right X
Axis 5 -> Right y
Axis 6 -> D-Pad X (binary like above - Note that you can't read D-Pad Y)

Any way you do it, a gamepad is a single joystick object.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
Reply With Quote