View Single Post
  #1   Spotlight this post!  
Unread 17-02-2010, 20:29
lsprague lsprague is offline
Registered User
FRC #3256 (WarriorBorgs)
Team Role: Programmer
 
Join Date: Feb 2010
Rookie Year: 2009
Location: San Jose, CA
Posts: 1
lsprague is an unknown quantity at this point
Programming Pots

We planned to set up joystick buttons to make the kicker move to a set position using potentiometers, but it keeps overshooting and getting stuck. Here's what we have:

Code:
if(rightstick->GetRawButton(HIGH_POT_BTN))
{
while(kickerValue != HIGH_POT)
{
GetWatchdog().Feed();
if(kickerValue>HIGH_POT)
winch->Set(Relay::kForward);
else 
winch->Set(Relay::kReverse);
}
else
winch->Set(Relay::kOff);
}
We tried using if instead of while because of watchdog problems, but that would only work by holding the button down. Now, the kicker pulls back too far and gets stuck. Does anyone know if it's a problem in the code or in the numbers we used for the pots?