View Single Post
  #10   Spotlight this post!  
Unread 06-02-2009, 16:54
Ethan Spitz Ethan Spitz is offline
President
FRC #3637 (The Daleks)
Team Role: Leadership
 
Join Date: Feb 2009
Rookie Year: 2011
Location: New Jersey
Posts: 133
Ethan Spitz is an unknown quantity at this point
Re: [FTC]: Toggle controls

What do you mean it makes the servos reverse themselves?

Also, I don't see how that works if the counter resets itself each time, it wouldn't stay I don't believe

Code:
int touch = 1;
//put variable before while loop

if(joy2Btn(1)) {
   if(touch == 1){
     touch = 0;
   }else{
     touch = 1;
   }
}

//you may want a really short wait here so when you press the button it does not switch back to original really quick

if(touch == 1){
  servo[ServoB] = 100;
}else{
  servo[ServoB] = 0;
}
Reply With Quote