View Single Post
  #9   Spotlight this post!  
Unread 06-02-2009, 16:14
nate15810's Avatar
nate15810 nate15810 is offline
World's Most Clueless Programmer
FTC #0154 (154 Renegade)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Rhode Island
Posts: 22
nate15810 is an unknown quantity at this point
Re: [FTC]: Toggle controls

yeah, i put that in and reset the servo values, but it just reversed the servo...
here's my code
Code:
int sum = 2;

if(joy2Btn(2)) // if button 2 is pressed
{
sum = sum +1;
}

int calcremainder = sum % 2; // This line calculates the remainder of sum/2.

if (calcremainder == 0) <this was an error in your lines...it needed a double=
{
servo[ServoB] = 100;
}
else
{
servo[ServoB] = 0;
}
Reply With Quote