First time VEX, need help about autonomous program via ROBOTC!

under the File menu->new->Driver Skill Template, there is a “example code”.
Since we got a damaged field control, there’s no way to test our code before real game, and no way for us to know if our code workding. We just not sure about the code format:confused:
here’s a little code:

#pragma config(Sensor, dgtl1, encoder1, sensorQuadEncoder)
#pragma config(Motor, port1, motor1, tmotorVex393_HBridge, openLoop)
//!!Code automatically generated by ‘ROBOTC’ configuration wizard !!//

#pragma platform(VEX)

//Competition Control and Duration Settings
#pragma competitionControl(Competition)
#pragma autonomousDuration(0)
#pragma userControlDuration(60)

#include “Vex_Competition_Includes.c”

void pre_auton()
// Set bStopTasksBetweenModes to false if you want to keep user created tasks running between
// Autonomous and Tele-Op modes. You will need to manage all user created tasks if set to false.
bStopTasksBetweenModes = true;//I dont know how to set this when doing 60s auto.
SensorValue[encoder1] = 0;
void move(){
while(SensorValue[encoder1] < 10000){
motor[motor1] = 127;
}motor[motor1] = 0;

task autonomous()
motor[motor1] = -127;
move(); // Remove this function call once you have “real” code.

task usercontrol()

while (true)
  motor[motor1] = vexRT[Ch1];		

Could this code work during real game?
Could anyone give some detail advise on how to use ROBTOC to programming 60s autonomous:eek:

I think you can simulate a competition switch in RobotC by going through the following:

Robot >>> Debugger Windows >> Competition Control.

Similar window to this:

And it should pop up a window that looks like this:

Also, it’s best to place your code between code tags when presenting code on the forum:

Have you tried a competition switch?

Anyway the code looks good, but don’t take my word for it.

Aiden is correct. You should get a competition switch. This will also help with testing programming skills. As a matter of fact, many tournaments run their skills fields using the competition switch rather than using field controls tied to TM.

Thanks very much! This is very helpful!

We had a competition switch. But it got a BIG “disabled” label on it…

There’s also this, haven’t used it in a long time (may not be compatible with Windows 8.1 etc. I should probably check that), use with the programming cable to the joystick.
Competition switch PC/Mac application