TETRIX FTC Templates

Revision as of 14:30, 11 September 2012 by Jwatson (Talk | contribs)

Jump to: navigation, search

FTC Templates

ROBOTC has built-in FTC templates that can be used to quickly and easily program a robot for both the autonomous and tele-op (remote control) portions of a competition. To open a template through ROBOTC, navigate to the File menu and select "New". There are three options under this menu:
  • New File - Creates a blank ROBOTC file.
  • Autonomous Template - Creates a FTC Autonomous Template (used for the autonomous portion of the competition.
  • User Control Template - Creates a FTC User Control Template (used for the autonomous portion of the competition.
For FTC competitions we will want to focus on the latter two options, Autonomous Template and User Control Template.

Autonomous Template

After creating a new autonomous template, you will be greeted by segments of code that my look new to you. The first three #pragma statements are automatically generated by ROBOTC to set up a basic TETRIX bot and will more than likely be changed as ROBOTC is configured for your specific robot (through the Motors and Sensors Setup page).
The next line of code is an what is called an "include" command. These commands tell ROBOTC to look at other files (in this case, the file named "JoystickDriver.c") for functions and commands. This is useful if certain segments of code are used in multiple programs; instead of having to copy the code into every program that would use it, said programs only have to have to 'include' the file. For instance, the JoystickDriver.c file has all of the