View Single Post
  #5   Spotlight this post!  
Unread 07-01-2007, 20:18
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: EasyC: Execute code before autonomous

You only need to call isEnabled to make sure the while loop ends and you don't get stuck in initialize. Initialize is run every time you reset your robot to calibrate any sensors that may need it.

Code:
void Initialize ( void )
{
      while ( !IsEnabled() ) // while the robot is not enabled
      {
            if ( GetOIDInput ( 1 , 1 ) ) // If Trigger is Pulled Go Next Auto
            {
                  automode ++ ;
            }
            else if ( GetOIDInput ( 1 , 2 ) ) // If Thumb is pushed go prev automode
            {
                  automode -- ;
            }
            SetUserDisplay ( automode ) ; // send current automode to OI display
      }
}
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni

Last edited by Kingofl337 : 07-01-2007 at 21:29.