View Single Post
  #2   Spotlight this post!  
Unread 29-03-2011, 02:05
MikeE's Avatar
MikeE MikeE is offline
Wrecking nice beaches since 1990
no team (Volunteer)
Team Role: Engineer
 
Join Date: Nov 2008
Rookie Year: 2008
Location: New England -> Alaska
Posts: 381
MikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond repute
Re: Xbox Controller?

Quote:
Originally Posted by youxinche95 View Post
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.
Reply With Quote