![robotc command list robotc command list](https://slidetodoc.com/presentation_image_h/afd8ecd72f3becfb41bf8fb9f10d4646/image-8.jpg)
Programming for an NXT is like talking in another language. It is important to realize that the NXT doesn't understand words and numbers like we do. These functions contain a large number of instructions that translate our commands to something the NXT can understand. This grants us access to a large library of functions to perform actions with. RobotC is considered a high-level language. They are both a labeled set of instructions to follow. If you have trouble conceptualizing what a task is, think of it as a recipe card. Encapsulation will always consist of two symbols: one at the start to open, and one at the end to close. For tasks, we use curly braces to mark the start and end of the task. It acts as the boundaries of a container to relate the contents of the encapsulation with the preceding command. The next element is the text label of the task followed by the encapsulated instructions that make up the task.Įncapsulation is when you put a symbol at the start and end of something. In this case, we are creating a task and the NXT is now expecting certain elements to come next. This notifies the NXT that a particular construct is being created. The first part of any construct in RobotC is a "Command Declaration". "task main " will always be the first task to be launched. The designers of this system determined that the task labeled "main" which brings us to our second rule.Ģ. When this task ends, the NXT will close the program. This task is the only task that the NXT will automatically start. Tasks can be labeled anything so when you launch a program, the NXT looks for something called the "root task". By separating our instructions into tasks, we gain the ability to do multiple things at once. NXT actions shall reside within tasks.Ī task in the most simple of terms is a labeled container of instructions. The NXT/RobotC was designed with a number of rules that force us to write or programs in a certain way. When you open a new RobotC program, you start with a blank slate, with no instructions.