View Single Post
  #3   Spotlight this post!  
Unread 08-04-2013, 22:52
ekapalka's Avatar
ekapalka ekapalka is offline
Registered User
FRC #3216
 
Join Date: Dec 2012
Location: Bermuda
Posts: 277
ekapalka has a spectacular aura aboutekapalka has a spectacular aura about
Re: Xbox Controller Axis 3

If you're not entirely sure what axis it is, go to Run and type "joy.cpl" without quotes. There should be a mapping under the Properties tab (while the controller is plugged in). The triggers together are actually one axis, with the left side being zero through negative one and the right side being zero through positive one. That way, synchronous triggers always equal 0 (both pressed, neither pressed, both half-pressed, and so on). I think you would probably be better off with the bumpers (because they're boolean, like solenoids; on or off) for your purpose. Just my thoughts

Code:
//pseudocode
if (triggeraxis > 0)//Room for error? change 0 to 0.5
{
    //solenoid 1
}
else if (triggeraxis < 0) //should be some room for error, like -0.5
{
    //solenoid 2
}
else
{
   //set solenoid 1 and 2 to off
}
Reply With Quote