View Single Post
  #5   Spotlight this post!  
Unread 28-01-2013, 13:06
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,043
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Problem with Shooter Code for FRC

Quote:
Originally Posted by VikingRobotics View Post
I wanted to know if it is possible to program the buttons so that you push it once to turn the motors on and then push it again to turn them off
Try something like this:

Code:
button1now = leftstick.getRawButton(button1);
if (button1now && ! button1previous) {if (speed==0) speed=0.3; else speed=0.0;} 
button1previous = button1now;
... repeat for buttons 2 and 3.


Reply With Quote