Thread: Gamepad help
View Single Post
  #3   Spotlight this post!  
Unread 12-03-2012, 18:11
Alexander Meyer Alexander Meyer is offline
Registered User
FRC #2358 (Bearbotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Lake Zurich, Illinois
Posts: 36
Alexander Meyer is on a distinguished road
Re: Gamepad help

If you do have the F310, I wrote a class a while back to make using it easier. You can find it here:

http://www.chiefdelphi.com/forums/sh...ad.php?t=90022

If you'd like to write your own code, you can at least use it for the axis and button mappings. If not, usage is very similar to a regular WPILib Joystick.

Code:
F310 *gamepad = new F310(1);
float leftX = gamepad->GetX(F310::kLeftStick);
float rightY = gamepad->GetY(F310::kRightStick);

bool leftTrigger = gamepad->GetButton(F310::kLeftTrigger);

delete gamepad;
gamepad = NULL;
jsmeldru, perhaps we have different versions of the F310? I'm able to read all 12 buttons as well as both DPad axes.
Reply With Quote