Autonomous Testing

How does one test an autonomous program that’s apart of an entire competition code program without using a competition control switch?

You have a couple of choices.

  1. If you are connected to the RobotC IDE using the programming cable connected to the joystick, you can use the competition control debug window.

  2. You can move all you code to a temporary program and just run it in the main task.

  3. You can use some fairly complicated code like we discussed in this thread and start from the joystick.
    https://vexforum.com/t/triggering-autonomous-mode/38408/1

  4. When a competition switch is not connected the usercontrol task will always run. You can make a minor temporary modification and start the autonomous task at the beginning of usercontrol task. Something like this;

// This code is for the VEX cortex platform
#pragma platform(VEX2)

// Select Download method as "competition"
#pragma competitionControl(Competition)

//Main competition background code...do not modify!
#include "Vex_Competition_Includes.c"

void pre_auton()
{
  bStopTasksBetweenModes = true;
}

task autonomous()
{
    // auton, drive for three seconds
    motor port2 ] = 100;
    motor port3 ] = 100;
    wait1Msec(3000);
    motor port2 ] = 0;
    motor port3 ] = 0; 
}

task usercontrol()
{
  // Start the auton code for testing, remove later
  startTask( autonomous );
  wait1Msec(15000);
  stopTask(autonomous);
  stopAllMotors();

  // tank control
  while (true) {
    motor port2 ] = vexRT Ch3 ];
    motor port3 ] = vexRT Ch2 ];  
  }
}

what this does is start the autonomous task, wait for 15 seconds then stop that task and all the motors. You must remove (or comment out) this code when you actually go to the competition.