What an OpMode Does
Understand the program the Robot Controller runs after it is selected on the Driver Station.
Understand the program the Robot Controller runs after it is selected on the Driver Station.
In this lesson, you will:
An OpMode is a program that appears on the Driver Station. In FTC, programmers usually write either a TeleOp OpMode for driver control or an Autonomous OpMode for pre-planned actions.
LinearOpMode runs like a normal script: initialize hardware, wait for start, then repeat while the match is active.
Everything above waitForStart() runs when the driver presses INIT, before the match begins. That is the place for hardware setup and a ready message. The code inside while (opModeIsActive()) is your real-time loop — keep it fast and free of long sleeps.
HelloTeleOp.javaJava
@TeleOp(name = "Hello TeleOp")
public class HelloTeleOp extends LinearOpMode {
@Override
public void runOpMode() {
telemetry.addLine("Ready for Westlake Robotics");
telemetry.update();
waitForStart();
while (opModeIsActive()) {
telemetry.addData("Runtime", getRuntime());
telemetry.addData("Left stick Y", gamepad1.left_stick_y);
telemetry.update();
}
}
}Check your understanding before moving on.
What does waitForStart() actually do?
Why does the loop check opModeIsActive()?
0 of 2 answered
Mark this lesson complete — “Variables, Types, and Units” is up next.