
This is similar to an event based programming model. The key idea is that you do not write a "loop" in your code, the base OpMode provides that for you by calling the loop method repeatedly on a timed basis.
WHERE TO DOWNLOAD FRC DRIVER STATION CODE
You write code to respond to these calls to loop(). In a regular OpMode, the predefined method loop() is called repeatedly during robot operation. OpModes are of two types, regular and linear. Your code repeatedly runs in a loop obtaining input, acting on that input and doing it again. All robot programs are essentially a looping activity.
WHERE TO DOWNLOAD FRC DRIVER STATION DRIVER
When a robot is being operated, the driver station is used to select an OpMode and the controller phone runs only that OpMode.Ī quick refresher on robot coding. We discuss extending classes in this lesson. A class that is an extension of another class is a descendant or sub-class: it has (inherits) the properties and methods of the original, but those can be changed or added to. Each "program" we write for our robot is a class that “extends” the OpMode class. In essence, we add functionality to the base application by adding new OpModes to it. So how do we do this? We create a new class and extend the FTC provided OpMode class. Here is a quick video overview of OpModes.

We don't modify that other part of the code, we just create the custom robot behavior we want by adding our own OpModes. Your code is really just a part of the controller app, with the rest of the app supplied by the FTC source code.


You create this class to add your code to the controller app. The term OpMode or Operational Mode (also Op Mode and opmode) refers to a class located within the FTC SDK (robot controller app source code).
