Quote:
Originally Posted by youxinche95
How do we access the current value of the view hat i.e. the arrow keys between the two joysticks. Thanks in advance!
|
The XBox controller effectively has 7 axes but unfortunately the HID standard supported by wpilib only returns 6 axes of control.
The left & right joysticks use 2 each as expected, but the two triggers also use an axis with the left trigger giving negative values and the right positive. Thus the amount of trigger displacement can be detected, not just a binary value of each trigger.
The Directional Pad (D-pad) uses the 6th and 7th axis, but you only have access to the 6th axis via getRawAxis. Therefore code can detect left & right directions on the D-pad, but not up / down.
A more complete answer including button mappings can be found here:
http://www.chiefdelphi.com/forums/sh...45&postcount=8
There may be a way of circumventing the standard XBox axis mapping through its device driver, but I haven't looked into that.