View Single Post
  #10   Spotlight this post!  
Unread 04-02-2015, 23:37
mmaunu's Avatar
mmaunu mmaunu is offline
Registered User
FRC #2485 (W.A.R. Lords)
Team Role: Mentor
 
Join Date: Mar 2013
Rookie Year: 2010
Location: San Diego, CA
Posts: 89
mmaunu is a jewel in the roughmmaunu is a jewel in the roughmmaunu is a jewel in the roughmmaunu is a jewel in the rough
Re: Limit Swtich Help

Quote:
Originally Posted by Jon Stratis View Post
For example, to say "when button 4 is pressed and the limit switch is not pressed", you would do "xbox.getRawButton(4) || !limitPressed". Figuring out how to use logic like this is a very powerful tool while programming!
Just to clarify for others, the condition would have && instead of ||:
Code:
    xbox.getRawButton(4) && !limitPressed
which is what you said very clearly but we all get noise in our signal sometimes between the brain and the fingers

Reps from Ether! I am showing my students that one!!! You might have a little bit of a fan club here at Team 2485...we seriously owe a lot to you and it is a shame if I haven't said that and "thank you" before (which is probably the case as I am mainly a lurker...but I am working on it).
__________________
2014 Las Vegas (Winners with 987, 2478; Excellence in Engineering)
2014 San Diego (Finalists with 987, 3250; Quality Award)
2013 Inland Empire (Winners with 1538, 968; Excellence in Engineering Award)
2013 San Diego (Finalists with 2984, 4322; Creativity Award)
2012 Las Vegas (Finalists with 2034, 3187; Quality Award)
Reply With Quote