Thread: Xbox Axis Help
View Single Post
  #4   Spotlight this post!  
Unread 31-01-2015, 17:06
kinganu123 kinganu123 is offline
Registered User
FRC #1747
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Piscataway, NJ
Posts: 243
kinganu123 is on a distinguished road
Re: Xbox Axis Help

Code:
 boolean buttonPressedForwardSpike = false; // these are in init.
   
    boolean buttonPressedForwardVictor = false; // init
            // !!The below statement doesn't evaluate to a boolean
            if (xbox.getRawAxis(5)) {  // 5 being the Y axis on right stick
            	
            	spike1.set(Relay.Value.kForward);
            	spike2.set(Relay.Value.kForward);
            	buttonPressedForwardSpike = true;
            	
            // !!!!!!!!!!! The below staetment assigns instead of comparing
            } else if (buttonPressedForwardSpike = true) {
            	
            	spike1.set(Relay.Value.kOff);
            	spike2.set(Relay.Value.kOff);
            	buttonPressedForwardSpike = false;
            }
If that's the exact one, then yeah, it SHOULD be fine. Though I'd still recommend checking it, for sanity reasons.
__________________
Reply With Quote