|
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.
|