EasyC/IR problems in Autonomous

Hey, we have our program here and it works in Operator Interface, but not Autonomous. We just thought u guys could look at it and help us make it work. Thanks.

We want it so that when we press a button, it turns on the spike and moves the pistons for our pneumatics. The operator control works, but when we put the same thing in Auton it doesn’t work.

http://whlspacedude.googlepages.com/piston.zip

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.


void Autonomous ( void )
{
      unsigned char IR1; 

      while ( 1 )
      {
            ir1 = GetDigitalInput ( 1 ) ;
            if ( ir1 == 1 )
            {
                  SetRelay ( 2 , 1 , -1 ) ;
                  Wait ( 10 ) ;
                  SetRelay ( 2 , 0 , -1 ) ;
            }
      }
}



Gracious senor, we’ve got it working, just to give you an update.