Select an object to represent the Moon and place it in an open area. Students will program their robots to move around it.
To access the full video please subscribe to FLLCasts.com
- #2587
- 10 Feb 2026
Mark the starting position (the base) using tape. The robots should be able to reach the side of the “Moon” with a single straight movement.
Do not allow students to spend more than 5 minutes on the task "Take up to 5 minutes to check if it's possible to program the robot to move forward for 2 seconds by rotating both motors at the same time using only the "run_time" command.". Students should realize that this is not possible because the program waits for one motor to finish before starting the other.
Solution to the task "Now that you know about the "await" command, try again to program the robot to move forward for 2 seconds using only "run_for_time()", but use await only on the second motor command.":
from motor import run_for_time import runloop import motor, time async def main(): # write your code here run_for_time(port.D, 2000, 1000) await run_for_time(port.F, 2000, 1000) runloop.run(main())
The second run_for_time command must use "await".
Solution to the task "Now that you know how to use the API, program the robot to move forward for 2 seconds using the "motor_pair.move_for_time()" function".
from hub import port import runloop import motor_pair async def main(): # Pair motors on port A and B motor_pair.pair(motor_pair.PAIR_1, port.F, port.D) # Move straight at default velocity for 1 second await motor_pair.move_for_time(motor_pair.PAIR_1, 2000, 0) runloop.run(main())
Courses and lessons with this Tutorial
This Tutorial is used in the following courses and lessons
Level A: Python Foundations – Robotics with LEGO SPIKE Prime
This is the first level of the LEGO Robotics Curriculum with Python, designed for students in grades 2, 3, and 4.
In this robot adventure, students learn to control robots using real Python code, while teachers guide them through their first steps in text-based programming. Throughout the level, students build a variety of LEGO SPIKE Prime robot models and program them to move, turn, and complete tasks with increasing precision.
Step by step, students learn how to read, understand, and write their own Python programs. Through fun and creative challenges, they bring their robots to life and discover how code can control movement, solve problems, and interact with the world. Along the way, they explore concepts such as navigation, obstacle avoidance, and sensor-based behavior.
The curriculum is designed to help teachers introduce programming in an engaging and approachable way while giving students plenty of opportunities to experiment, test ideas, and develop confidence in their coding skills.
By the end of the level, students apply everything they have learned in an exciting robotics competition. Using their own programs and robot designs, they complete missions on a competition field with boxes, putting their coding, engineering, and problem-solving skills to the test.
- 46
- 4:32
- 78
Lesson 3 - Luna 3
Introduction
Today’s lesson is inspired by an exciting moment in space exploration - a mission to the Moon. Your robot will act as an astronaut, and you will use an object in the classroom to represent the Moon.
Your robot will travel around the “Moon,” stop at the right moment, and take a picture before returning to its starting point. Instead of a real space camera, you will use a phone set to take photos automatically.
By the end of the lesson, you will have your own mission photo - just like real space engineers who collect data from faraway places.

- 5
- 4
- 9
- 3d_rotation 1