View Single Post
  #2   Spotlight this post!  
Unread 18-01-2008, 13:38
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/IR problems in Autonomous

Well, technically this shouldn't work in Operator Control or Autonomous. But Operator Control loops due to the way WPILIB is written. But, both you Autonomous and Operator Control should have a while() loop. Here is how it should look.

Code:
void Autonomous ( void )
{
      unsigned char IR1; 

      while ( 1 )
      {
            ir1 = GetDigitalInput ( 1 ) ;
            if ( ir1 == 1 )
            {
                  SetRelay ( 2 , 1 , -1 ) ;
                  Wait ( 10 ) ;
                  SetRelay ( 2 , 0 , -1 ) ;
            }
      }
}
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni