Make sure you are using a Competition Template for your code, (one that has sections for Initialize, Autonomous, and Operator Control) or it won’t work properly at a competition.
You can program a robot to do Autonomous with no sensors, and that’s perfectly fine and acceptable.
Most Autonomous Routines consist of two main parts: Setting Motor Speeds and Waiting. The first one is an important concept. Once you tell a motor to go at a certain speed, it will stay that way until you tell it something else. When the Cortex (that’s the robot brain) goes through this code, it executes extremely fast, speeding from one statement to the next with hardly any pause; that’s why we use Wait statements to tell it to sloooow down before it moves on to the next thing.
For instance, if you wanted your robot to turn for 5 seconds, (assuming your drive motors are in ports 2 and 3) you might have:
SetMotor ( 2 , 127 ) ;
SetMotor ( 3 , -127 ) ;
Wait ( 5000 ) ;
SetMotor ( 2 , 0) ;
SetMotor ( 3 , 0) ;
First, the code tells the Cortex to turn on the drive motors. The Cortex executes the first SetMotor command (starting motor 2 one way), instantly moves to the second SetMotor command (starting motor 3 the other way), and finally stops at the Wait command.
Second, the Wait command says “Don’t go on to the next statement until 5000 miliseconds (5 seconds) are up!” So the Cortex sits there faithfully for five seconds while the motors are still spinning.
And finally, the Cortex zips through the last two commands which stop the motors virtually simultaneously. Since this is the end of your code, it just waits there for you to turn your robot off and try it again!
That’s basically all Autonomous is, except with a lot more motor and wait commands. Also, the commands can sometimes be put into a function for easy reuse:
void Turn ()
{
SetMotor ( 2 , 127) ;
SetMotor ( 3 , -127 ) ;
}
Now, instead of having to put in all those SetMotor commands in your Autonomous Code, you can just put in one Turn();
Learn more here: EasyC Tutorial - VEX Robotics -Programming User Functions - YouTube
As for the competition switch, you can find a simulator in the Terminal Window on the last tab. As long as the orange USB-Serial Cable is plugged into the joystick, and the joystick is paired with the Cortex, you can use that to control what mode it is in.
More helpful resources can be found here:
http://www.intelitekdownloads.com/tutorials/launch_cortex.html
http://www.engr.sjsu.edu/E10/E10pdf/EasyC_environment.pdf (old, but still has good basic info)