View Single Post
  #8   Spotlight this post!  
Unread 05-02-2013, 20:03
thecakeisalie's Avatar
thecakeisalie thecakeisalie is offline
Registered User
FRC #0293
 
Join Date: Mar 2012
Location: Pennington
Posts: 37
thecakeisalie is an unknown quantity at this point
Re: How to create an On/Off button?

Quote:
Originally Posted by Ether View Post

Code:
button1 = GetButton(button1);
if (button1 && ! button1previous) toggle1 = !toggle1;
button1previous = button1;
initialize toggle1 to zero.


Thank you. This is exactly what I was looking for but couldn't write myself
I assume that if you wanted to start with the motors running, I would initialize toggle as true?
Reply With Quote