Thread: Xbox Axis Help
View Single Post
  #3   Spotlight this post!  
Unread 31-01-2015, 16:51
curtis0gj curtis0gj is offline
Registered User
FRC #5033 (Beavertronics)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Canada
Posts: 121
curtis0gj will become famous soon enough
Re: Xbox Axis Help

Quote:
Originally Posted by kinganu123 View Post
Use the driver station to find the raw axis values of the individuals joysticks (it's on one of the tabs on the bottom left hand side). Then, just call getRawAxis() on that axis you find.
Also, I'm sure if you look around on chiefdelphi, you'll find that people have already posted up their xbox class.
Could I use this picture http://team358.org/files/programming...rolMapping.jpg for the values or do I need to check the actual readings?

Code:
 boolean buttonPressedForwardSpike = false; // these are in init.
   
    boolean buttonPressedForwardVictor = false; // init

            if (xbox.getRawAxis(5)) {  // 5 being the Y axis on right stick
            	
            	spike1.set(Relay.Value.kForward);
            	spike2.set(Relay.Value.kForward);
            	buttonPressedForwardSpike = true;
            	
            	
            } else if (buttonPressedForwardSpike = true) {
            	
            	spike1.set(Relay.Value.kOff);
            	spike2.set(Relay.Value.kOff);
            	buttonPressedForwardSpike = false;
            }
Reply With Quote