Skip to content
All weeks
04Week 4

Programming Fundamentals

From your first variable to a robot you can drive.

This week your team learns to make the robot move under driver control. You will start with the core ideas every program uses (variables, conditionals, loops and methods), then meet the FTC SDK, configure the Control Hub, and control motors and servos from Java. By the end of the week you will have written and debugged a complete Driver-Controlled (TeleOp) OpMode for your own robot.

5
Lessons
10 team hours
Estimated time
5
Learning objectives
Start lesson
Game of the week

Program the path

Write a program from simple commands and watch the robot run it tile by tile — exactly like a real OpMode, without guessing.

How to play
  1. 01Add commands: forward, back, turn left or right (and grab in level 3).
  2. 02The code on the right shows your program as Java-style lines.
  3. 03Press Run. Solve a level on the first try for 2 points, later for 1.
Recommended video

Lessons by Brogan M. Pratt

Video tutorials from the FTC community. Watch them alongside this week's lessons.

Code

Full Course: How to Program ANY Linear Slide Mechanism (Java)

YouTube

Video by Brogan M. Pratt

Educational content shared with permission. Brogan M. Pratt is not officially affiliated with or endorsing Rookie Academy or FIZMAT ROBOTICS #28061.

Original video: youtube.com/@BroganMPratt

Recommended video

Lessons by Programming with Mosh

Video tutorials from the FTC community. Watch them alongside this week's lessons.

Code

Java Full Course for Beginners

YouTube

Video by Programming with Mosh

Programming with Mosh is not officially affiliated with or endorsing Rookie Academy or FIZMAT ROBOTICS #28061.

Original video: youtube.com/@programmingwithmosh

Code

Object-Oriented Programming, Simplified

YouTube

Video by Programming with Mosh

Programming with Mosh is not officially affiliated with or endorsing Rookie Academy or FIZMAT ROBOTICS #28061.

Original video: youtube.com/@programmingwithmosh

Code

Java Interfaces Tutorial

YouTube

Video by Programming with Mosh

Programming with Mosh is not officially affiliated with or endorsing Rookie Academy or FIZMAT ROBOTICS #28061.

Original video: youtube.com/@programmingwithmosh

Code

Git Tutorial for Beginners: Learn Git in 1 Hour

YouTube

Video by Programming with Mosh

Programming with Mosh is not officially affiliated with or endorsing Rookie Academy or FIZMAT ROBOTICS #28061.

Original video: youtube.com/@programmingwithmosh

Lessons255 min

  1. 01Programming Concepts in JavaLearn the four building blocks of every robot program: variables, conditionals, loops and methods, written in the Java language used by the FTC SDK. 45 min
  2. 02The FTC SDK, Programming Tools and Robot ConfigurationMeet the FTC SDK and its three programming tools, then create a robot configuration on the Control Hub whose device names match your code exactly. 50 min
  3. 03Motors and Servos in CodeControl DC motors with power, direction and zero-power behavior, and move servos to tested positions with `setPosition`. 45 min
  4. 04TeleOp OpModes and Gamepad ControlsBuild a complete TeleOp OpMode with `LinearOpMode`, understand its lifecycle from INIT to STOP, and map gamepad sticks and buttons to robot actions. 55 min
  5. 05Mecanum Drive and Debugging with TelemetryWrite a robot-centric mecanum drive with normalised motor powers, then use telemetry and a clear process to find and fix common errors. 60 min
Team assignment

Create a Working Driver-Controlled Robot Program

Write a TeleOp OpMode that lets a driver control your robot with a gamepad. The drivetrain must move forward, backward and turn (and strafe if you have mecanum wheels), with motor powers kept inside the range -1 to 1. Add at least one extra control, such as a servo on a button or a slow-mode button, and show useful telemetry on the Driver Station. Test it with the wheels off the ground first, then on the field tiles, and fix every problem you find.

Deliverables

Tick items off as your team completes them.

0/5

Learning objectives

  • Explain variables, conditionals, loops and methods and use them in Java.
  • Compare Blocks, OnBot Java and Android Studio and set up one of them for the team.
  • Create a robot configuration on the Control Hub whose names match the code exactly.
  • Control motors and servos from code, including direction, power and servo positions.
  • Write, test and debug a TeleOp OpMode that drives the robot with a gamepad.

Required materials

  • REV Control Hub with a charged 12 V robot battery and main power switch
  • Driver Station (REV Driver Hub or a supported Android phone) with the current Driver Station app
  • One or two supported USB gamepads
  • A drivetrain with 2 or 4 motors from earlier weeks (mecanum recommended) and at least one servo
  • Laptop with a modern web browser (for Blocks or OnBot Java); optionally Android Studio installed
  • REV Hardware Client on a laptop for updating Control Hub and Driver Hub software
  • A box or stand that lifts the drive wheels off the ground for safe testing
  • Safety glasses for everyone near a powered robot

Expected outcomes

  • Students can read and write short Java programs that use variables, if/else, loops and methods.
  • The team has an active, named robot configuration and a written list of every device name and port.
  • Students can set motor direction, power and zero-power behavior, and tune servo positions safely.
  • Students understand the LinearOpMode lifecycle and can map gamepad inputs to robot actions.
  • Students can use telemetry to find and fix common programming errors.

Knowledge check

19 questions across this week's lessons. Your best score for each lesson is saved.

  • Programming Concepts in Java–/4
  • The FTC SDK, Programming Tools and Robot Configuration–/4
  • Motors and Servos in Code–/3
  • TeleOp OpModes and Gamepad Controls–/4
  • Mecanum Drive and Debugging with Telemetry–/4

Completion checklist

Tick items off as your team completes them.

0/8