Thread: Xbox Axis Help
View Single Post
  #7   Spotlight this post!  
Unread 31-01-2015, 20:44
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

I may need some further assistance the getRawAxis is giving me an error saying that it cannot covert from double to boolean.

Code:
boolean buttonPressedForwardSpike = 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