View Single Post
  #5   Spotlight this post!  
Unread 02-04-2015, 06:12 PM
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: Limit Swtich Help

Quote:
Originally Posted by Ether View Post
True. (Hey, a little Boolean humor there).



You don't need "==" to return a Boolean: a single "=" inside an if() statement will indeed return a Boolean. But as you said above, not what the OP was expecting.

If you already have an appropriately-named Boolean variable, you can cleanly code it by simply testing the variable:

if (limitPressed) {...}


So I will keep my if statements to one =. The limit switch is still not working here is a link for a picture of it. http://imgur.com/nRB3VqN. We used ground and signal from our pwm and it goes to DIO 4.
Reply With Quote