Tutorials/ROBOTC Interface
From ROBOTC API Guide
| (5 intermediate revisions by one user not shown) | |||
| Line 72: | Line 72: | ||
Depending on the type of error, ROBOTC will only be able to highlight the approximate location of the error. For instance, in the example below the missing semicolon is on line 6, but ROBOTC will highlight line 7.<br /><br /> | Depending on the type of error, ROBOTC will only be able to highlight the approximate location of the error. For instance, in the example below the missing semicolon is on line 6, but ROBOTC will highlight line 7.<br /><br /> | ||
| − | [[File: | + | [[File:errors-explained.png]]<br /> |
ROBOTC generates three types of compiler messages: Errors, Warnings and Information Statements. | ROBOTC generates three types of compiler messages: Errors, Warnings and Information Statements. | ||
| Line 96: | Line 96: | ||
'''To add a breakpoint:'''<br /> | '''To add a breakpoint:'''<br /> | ||
Right-click on the line number where you wish to add a break point and a context menu will appear. Select "Insert Breakpoint" to place a breakpoint at that line.<br /><br /> | Right-click on the line number where you wish to add a break point and a context menu will appear. Select "Insert Breakpoint" to place a breakpoint at that line.<br /><br /> | ||
| − | [[File:insert-breakpoint.png]]<br /> | + | [[File:insert-breakpoint.png]]<br /> |
| Line 110: | Line 110: | ||
This message is just an indication that the breakpoint has been reached. Click OK and then look at your program in the code editor. ROBOTC will highlight the line of the breakpoint that program stopped at, allowing you to see exactly which breakpoint the program executed.<br /><br /> | This message is just an indication that the breakpoint has been reached. Click OK and then look at your program in the code editor. ROBOTC will highlight the line of the breakpoint that program stopped at, allowing you to see exactly which breakpoint the program executed.<br /><br /> | ||
[[File:execution-stopped.png]] | [[File:execution-stopped.png]] | ||
| + | |} | ||
| + | <br /> | ||
| + | |||
| + | === Bookmarks === | ||
| + | {|width="740px" | ||
| + | |- | ||
| + | |Bookmarks are useful for navigating larger ROBOTC programs. You can use bookmarks to jump from one line of code to the next. | ||
| + | |||
| + | |||
| + | '''To Add/Remove a Bookmark: (Ctrl-F2)'''<br /> | ||
| + | Right click on the line number that you wish to add or remove a bookmark and a context menu will appear. Select "Toggle Bookmark" to place or remove a bookmark at that line. Pressing Ctrl-F2 on your keyboard will also add or remove a bookmark on the line with the cursor.<br /><br /> | ||
| + | [[File:bookmarks-1.png]]<br /> | ||
| + | |||
| + | |||
| + | '''To Use Bookmarks: (F2) & (Shift + F2)'''<br /> | ||
| + | You can jump to the next line of code that has a bookmark by pressing the (F2) key on your keyboard, or by going to the "Edit" menu and selecting "Find Next Bookmark." You can also go to a previous bookmark by pressing (Shift + F2) , or going to the "Edit" menu and selecting "Find Prev Bookmark."<br /> | ||
| + | {| | ||
| + | |- | ||
| + | |[[File:bookmarks-next.png]] | ||
| + | |[[File:bookmarks-prev.png]] | ||
| + | |}<br /> | ||
| + | |||
| + | |||
| + | '''Clear all bookmarks: (Ctrl + Shift + F2)'''<br /> | ||
| + | You can clear all bookmarks by going to the "Edit" menu and clicking "Clear All Bookmarks". You can also use the keyboard shortcut (Ctrl + Shift + F2) to clear all bookmarks as well.<br /><br /> | ||
| + | [[File:bookmarks-clear.png]]<br /> | ||
| + | |||
| + | |||
| + | '''Bookmarks Toolbar:'''<br /> | ||
| + | If you have the Bookmarks toolbar enabled, you can use it to toggle, switch between, and clear bookmarks as well. To enable the Bookmarks toolbar, right-click on your toolbar and select "Bookmark".<br /><br /> | ||
| + | [[File:bookmarks-bar.png]] | ||
| + | |} | ||
| + | <br /> | ||
| + | |||
| + | == Status Bar == | ||
| + | {|width="740px" | ||
| + | |- | ||
| + | |The Status Bar gives you information about the ROBOTC editor and the current program.<br /> | ||
| + | |||
| + | [[File:status-bar.png]]<br /><br /> | ||
| + | |||
| + | #Context Help - Hover over different sections of the ROBOTC interface for brief descriptions. | ||
| + | #Download Target - Displays the current download target. | ||
| + | #Active Platform - Displays the currently selected platform type. | ||
| + | #Active Project - Displays the most recently compiled program. | ||
| + | #Read-only Status - Displays the file permissions for the most recently compiled program. | ||
| + | #*R/W - Read and Write Access | ||
| + | #*R/O - Read Only Access | ||
| + | #Compiler Errors - Displays the number of Warnings and Errors in a program, if any. | ||
| + | #Line/Column Display - Shows the line number and character of where the text cursor is currently located. | ||
|} | |} | ||
<br /> | <br /> | ||
Latest revision as of 11:22, 15 May 2012
Tutorials → ROBOTC Interface
Contents |
Overview
| ROBOTC for Mindstorms is an Integrated Development Environment. It has been developed to provide as much support as possible for the platforms it is compatible with. The ROBOTC interface will modify itself to accommodate the functionality found in your controller. ROBOTC extends the ‘C’ programming language with a number of built-in variables and functions to provide control over a robot’s hardware devices, i.e. the motors and sensors.
|
Editor
| This is the part of the interface where the user can write code. |
Code Templates / Function Library
| This portion of the interface allows user to see all the functions available in ROBOTC at their user level. Portions of code from the "Function Library" can be dragged into the Editor. |
Main Menu / Toolbar
| This area allows you to perform basic tasks (saving, copy & pasting, undo, etc.), switch between multiple open programs using the tabbed interface, and access all of ROBOTC's additional functionality through the various menus. |
Code Editor
Writing Code
| Writing Code is the primary focus of ROBOTC, being a C-Based development environment. The ROBOTC Code Editor provides some visual assistance while programming with the use of line numbers and color coding: Normal Text is displayed as black text. Normal text is used for variable and function names that are user-defined and not recognized by the compiler as reserved words. Comments are displayed as green text . Comment are any bits of text in a program prefaced with a "//" or a "/*". This "commented text" is not considered code and is ignored when the compiler is generating byte-code to send to the robot controller. Reserved Words/Pre-Defined Functions (int, motor) are displayed as bold blue text and italicized blue text. Constants and Parameters (127, port1) are displayed as red text. Syntax and Operands (+, -, *, {, <, [, etc.) are displayed as light red text. |
Error Display
Breakpoints
Bookmarks
Status Bar
The Status Bar gives you information about the ROBOTC editor and the current program.
|















