Section 8: Writing Your First FTC OpMode
Your robot code belongs in:
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/
Right-click this folder → New → Java Class. Name it DiagnosticOpMode.
Replace the generated content with the following. This is the minimum valid OpMode that proves your environment is working:
package org.firstinspires.ftc.teamcode;
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
import com.qualcomm.robotcore.eventloop.opmode.OpMode;
@TeleOp(name = "Diagnostic", group = "Setup")
public class DiagnosticOpMode extends OpMode {
@Override
public void init() {
telemetry.addData("Build", "Successful");
telemetry.addData("JDK", System.getProperty("java.version"));
}
@Override
public void loop() {
telemetry.addData("Runtime", getRuntime());
}
}
Press the green Build button (hammer icon, top toolbar). You should see BUILD SUCCESSFUL in the Build panel.
If the build succeeds, your environment is correctly configured.
Ready to move on?
Sign in with Google to save your progress with Telemark, or continue without saving.