ROBOTC is considered to be an "Integrated Development Environment." This means that ROBOTC has a custom text editor for developing code that will assist the programmer by color coding different potions of code to differentiate between integers, reserved words, functions and parameters.
ROBOTC also contains a compiler for turning this user generated code in a byte-code language that the different controller platforms can understand. To run the compiler, access the compile function from the "Robot" menu.
When the compiler runs, ROBOTC will check your program for errors and warnings that would cause your program to not run properly on the robot. Rather than send this broken code to your robot, ROBOTC will inform you of these errors so they can be corrected.
In the example below:
- The reserved word 'motor' was incorrectly typed as 'Motor', generating a warning. A warning tells the user that they've created an error, but ROBOTC is able to correct this error itself when the program is sent to the controller. A program with warning will compile successfully, but users should use good programming practice to avoid warnings. Warnings are denoted by a yellow "X".
- The code on line 5 is missing a semicolon, which is generating an error. An error will prevent the program from being sent to the controller. ROBOTC will do its best to explain what the error to assist the user. In this example, ROBOTC is informing the user they left a semicolon off a line of their program which is preventing the program from being compiled. Errors are denoted by a red "X".
Once your program has successfully compiled, you can send the program to the controller by clicking the "Compile and Download Program" option under the "Robot" menu. Note: Your robot must be turned on and connected to the computer before you can download a program.
Once the download starts, a "Download Progress" bar will appear. This bar will show the status of the transfer of the compiled byte-code to the controller.
Once the download starts, a "Download Progress" bar will appear. This bar will show the status of the transfer of the compiled byte-code to the controller.
Once the download finishes, ROBOTC's built in debugger will be launched. There will be a number of windows that launch, such as the Global Variables window, the Devices window and the Program Debug window. You can start your programs execution by clicking the "Start" button on the "Program Debug" window. Learn more about these windows in the 'Debugger' section of the help file.
|