Thread: XBox controller
View Single Post
  #3   Spotlight this post!  
Unread 09-12-2012, 17:15
Zuelu562's Avatar
Zuelu562 Zuelu562 is offline
Ready for WPI District!
AKA: Jake Janssens
FRC #3623 (Terror Bots)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Massachusetts
Posts: 340
Zuelu562 is a splendid one to beholdZuelu562 is a splendid one to beholdZuelu562 is a splendid one to beholdZuelu562 is a splendid one to beholdZuelu562 is a splendid one to beholdZuelu562 is a splendid one to beholdZuelu562 is a splendid one to beholdZuelu562 is a splendid one to behold
Re: XBox controller

My team used Xbox 360 controllers last year. In our code, we used Joystick.GetRawAxis() and tied it to a float. When we called RobotDrive.ArcadeDrive(), we handed it our floats.

Code:
float driverLeftY = driverXbox.GetRawAxis(2);
float driverRightY = driverXbox.GetRawAxis(5);

robotDriver.ArcadeDrive(driverLeftY, driverLeftX);
If I recall correctly, we ended up in the same situation as you, having trouble with GetAxis not working with an xbox controller. Handing it the GetRawAxis floats worked, and we ended up running with it.

If you're having trouble with any of the button or axis setups, this should help.
__________________
Team Resume
562 "S.P.A.R.K." - Student Programmer 2008-2011, Field Coach 2011
3623 "Terror Bots" - Technical Mentor, Field Coach 2012 - Present

Volunteer Resume:
BattleCry@WPI 12, 13, 15, 16 - Queuing
BattleCry@WPI 14 - Field Reset
Granite State District Event 2014 - Team Queueing
NEFIRST District Championships '14,'15,'16 - Team Queuing
Reply With Quote