|
Re: XboxController Class vs Joystick Class for KOP Xbox Controller
The XboxController class is new this year in wpilib, so most FRC example code will be written with the API that does not include it. If you look at the source code for the XboxController class (at C:\Users\(your user)\wpilib\java\current\lib\WPILib-sources\edu\wpi\first\wpilibj), you can see that it boils down to getRawAxis() and getRawButton() calls in GamepadBase, but does the figuring out of which controller button corresponds to which index for you.
For example, the method getAButton() literally just returns getRawButton(1).
Note: I assume it works the same way in C++, as I only checked the java source code.
__________________
The opinions expressed in this post are mine and do not necessarily reflect those of my team.
Last edited by Bradley Boxer : 19-01-2017 at 00:24.
Reason: clarity
|