To access the full video please subscribe to FLLCasts.com
- #2594
- 27 Feb 2026
Program the robot to move forward for 2 seconds using only the move_for_time() command.
from hub import port import runloop import motor_pair async def main(): # Pair motors on ports E and B motor_pair.pair(motor_pair.PAIR_1, port.E, port.B) # Move using the variables await motor_pair.move_for_time(motor_pair.PAIR_1, 2000, 100) runloop.run(main())
Program the robot to turn for 2 seconds by changing the steering input.
from hub import port import runloop import motor_pair async def main(): # Pair motors on ports E and B motor_pair.pair(motor_pair.PAIR_1, port.E, port.B) # Move using the variables await motor_pair.move_for_time(motor_pair.PAIR_1, 2000, 0) runloop.run(main())
from hub import port import runloop import motor_pair async def main(): # Pair motors on ports E and B motor_pair.pair(motor_pair.PAIR_1, port.E, port.B) # Move using the variables await motor_pair.move_for_time(motor_pair.PAIR_1, 2000, 100, velocity=-1000) runloop.run(main())
Create a variable for the speed of the motors and name it "motor_speed".
from hub import port import runloop import motor_pair motor_speed = 1000; async def main(): # Pair motors on ports E and B motor_pair.pair(motor_pair.PAIR_1, port.E, port.B) # Move using the variables await motor_pair.move_for_time(motor_pair.PAIR_1, 2000, 100, velocity=motor_speed) runloop.run(main())
There are no wrong solutions for the final tasks in this lesson. Students are encouraged to clear the field in any way they can. Here are a few tips to support those who may struggle:
Remind students that there is no fixed starting position behind the line. If they place their robot in line with the "rocks," they may be able to clear the first two with a single straight movement.
Allow students to modify their robots. For example, they can add a front wall to prevent the "rocks" from pushing the robot away during collisions. You can also suggest using this setup to try turning both motors in the same direction.
Manage expectations. If time is limited, use the time spent building the "rocks" to adjust the goal. A simple reminder like, "We are running short on time, so let’s try to remove three rocks before the end of the lesson," is enough. Be careful not to sound critical, as this may affect students’ motivation.
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 4 - Strange Bot
Introduction
Today, we will build a robot that can automatically clear a landing site.
Sending robots to the Moon is very expensive. Because of this, they are designed to fit into small spaces on spacecraft, rather than being easy to control. Today’s robot is built to simulate this challenge.
Before a spacecraft lands on the Moon, a robot is sent first to clear the landing area. Your robot starts on the Moon, and its task is to prepare the site for the landing of a larger spacecraft.

- 4
- 4
- 10
- 3d_rotation 1