A series of pre-defined templates are already available in easyC for your use in competitions like FIRST Tech Challenge, or informal in class competitions. A Competition Template provides a standardized platform for teams to use when competing in an event. There are many templates to choose from; each template has two periods of varying lengths, an autonomous period and an operator controlled period.
If you would like a custom competition template created for an in class competition, please contact the intelitek technical support department.
To open a Competition Template:
Go to File, and Select Open Project.
Change the ‘Files of Type’ from easyC Project to easyC Template using the drop down menu
The window will automatically display the default directory for Templates.
Choose your desired Template, and select Open.
No matter which template you choose, the Main Function will be displayed with two Function Blocks already defined. These Function Blocks refer to user functions which have also been pre-defined for your use. The numbers in parentheses indicate the length of time of each period. In the example shown below, the Competition Template ‘Mixed 2 min round 2’ will have an Autonomous period of 30 seconds followed by a Competition period of 90 seconds. If a period has a length of ‘0’ seconds, then that period will be skipped. To sequentially complete a Competition Template, do not use any of the jumper options described below.
Normally easyC keeps track time in milliseconds (1/1,000 of a second). Only in the Main Function of Competition Templates is time expressed in seconds.
You should have reason to program in both Autonomous and Operator Controlled Modes at some point during your preparation for a competition. In a Competition Template with both periods, the Autonomous period will always precede the Operator Controlled period.
Autonomous Mode allows the robot to move independently of any operator controls for a prescribed length of time. The Autonomous period will begin when your robot first sees a signal from your transmitter. Your robot will then follow a programmed sequence of events, and will ignore all subsequent information from the transmitters. The orange eye on the controller will blink when the controller is in Autonomous Mode.
This means that switching off your radio controller WILL NOT deactivate the Autonomous period or your robot.
At the end of the allotted Autonomous period, your robot’s program will stop automatically. If the Autonomous period is followed by an Operator Controlled period, the Operator Controlled period will begin immediately.
If a jumper is placed in interrupt 5, only the Autonomous portion of the template will be executed.
Programming in the Autonomous Mode is very similar to creating a normal autonomous project. The only difference is that you should treat the Autonomous Function (contained in the user functions group) as if it were your Main Function when programming. The Autonomous Function does not have its own globals (use the regular Program Globals for those), however you should call your user functions from the Autonomous Function.
Operator Controlled Mode
Programming in the Operator Controlled Mode is very similar to programming in a normal project. The Operator Controlled period does not contain any predefined instructions, in fact it is completely blank at the start just like the Autonomous period. You have the ability to communicate with your transmitter during this period however, so you may add blocks from the RC Control group to drive your robot. You could also choose not to do this, and instead give your robot a further series of Autonomous instructions. Be careful when mixing Autonomous and RC commands.
Switching off your radio controller during the Operator Controlled period will stop your robot. If you turn your controller back on, your robot program will continue to execute until the allotted time expires.
At the end of the allotted Operator Controlled period, your robot’s program will stop automatically.
If a jumper is placed in interrupt 6, only the Operator Controlled portion of the template will be executed.