Testing autonomous mode - Cortex

How can I program the duration of the autonomous mode using the Competition Template in EasyC v4 for Cortex?

The main program shows the Autonomous to be passed a ‘0’ as the argument. Where can I specify it to be 20 seconds, and where can I specify 1 minute? Is there a configuration I have to change somewhere?


I noticed there is a function:

void SetCompetitionMode(int nCompTime, int nOperTime);

in api.h

Do I just call this function during the init? Is there anywhere I can get documentation on everything in api.h?


No you can’t because VexNet controls autonomous time. You can use the competition switch emulator Located in the Terminal Window and Graphics Display.

So, how would I test a 20 second autonomous period accurately? And, how would I test a 1 minute Programming skills and Robot Skills?

I would rather not have to just sit there with a stop watch and click on enable and disable on the Terminal Window. Is there any other way to do this?


Right now we do not have a solution for you perfect solution for you. We have been asked modify the competition switch to include a timer. It is on the plan for a future build.

For now you could use the GetTimer() function to kill the loop.


while(GetTimer(1) < 20000 ) //20 Seconds
//operator or autonomous code