Log in

View Full Version : EasyC/IR problems in Autonomous


cardinalman86
17-01-2008, 16:31
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

Kingofl337
18-01-2008, 13:38
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 ) ;
}
}
}

cardinalman86
22-01-2008, 15:50
Gracious senor, we've got it working, just to give you an update.