View Single Post
  #1   Spotlight this post!  
Unread 16-02-2013, 10:16
nickpaterni's Avatar
nickpaterni nickpaterni is offline
Programming Mentor - Java
FRC #0217 (The Thunderchickens)
Team Role: Mentor
 
Join Date: Nov 2012
Rookie Year: 2012
Location: Mt Clemens, MI
Posts: 16
nickpaterni is an unknown quantity at this point
Ramping up motor tied to a button

Currently, we have a command tied to a button that will activate a motor, but we want to be able to gradually get that motor up to 100%. The code so far looks like:

void RaiseArm::Execute() {
while(Power < 1)
{
arm->TurnOn(Power);
Power += MOTOR_RAMP_UP_AMT;
}

the command is called in OI via a WhileHeld(). Is there a better way to do this?
Reply With Quote