Teacher's Notes Pro Preview

To access the full video please subscribe to FLLCasts.com

Subscribe

  • #2602
  • 13 Mar 2026

"Display "Hello World" text on the screen"

from hub import light_matrix
import runloop

async def main():
    light_matrix.write("Hello World")

runloop.run(main())

"Create a numeric variable named "hours" equal to 2 and use the light_matrix.write() command to display it on the screen."

from hub import light_matrix
import runloop

hours = 2

async def main():
    light_matrix.write(str(hours))

runloop.run(main())

"Program the "hours" variable to be a randomly selected number between 1 and 12. Test your program and tell us what number you saw on the display."

from hub import light_matrix
import random
import runloop

hours = random.randint(1, 12)

async def main():
    light_matrix.write(str(hours))

runloop.run(main())

"Create another variable and name it "minutes" equal to a random number between 1 and 60. Show it on the screen and tell us what number you saw on the display."

from hub import light_matrix
import random
import runloop

hours = random.randint(1, 12)
minutes = random.randint(1, 60)

async def main():
    light_matrix.write(str(minutes))

runloop.run(main())

"Display the hours and minutes variables separated by a colon."

from hub import light_matrix
import random
import runloop

hours = random.randint(1, 12)
minutes = random.randint(1, 60)

async def main():
    light_matrix.write(str(hours) + ":" + str(minutes))

runloop.run(main())

"How many degrees does the short arrow of the clock have to rotate to show that an hour has passed? (360/12)"

30

"Create a variable named "hour_degrees" equal to the randomly selected number of hours in the variable "hours" multiplied by (360/12)."

hours = random.randint(1, 12)
hour_degrees = hours * 30

"How many degrees does the long arrow of the clock have to rotate to show that one minute has passed? (360/60)"

6

"Create another variable named "minutes_degrees" equal to the randomly selected number of minutes in the variable "minutes" multiplied by (360/60)."

minutes = random.randint(1, 60)
minutes_degrees = minutes * 6

"Program the robot's short arrow to move a number of degrees equal to "hour_degrees" with a speed of 360."

from hub import port
import motor
import random
import runloop

hours = random.randint(1, 12)
hour_degrees = hours * 30
minutes = random.randint(1, 60)
minutes_degrees = minutes * 6

async def main():
    motor.run_for_degrees(port.E, hour_degrees, 360)

runloop.run(main())

"Program the robot's long arrow to move a number of degrees equal to "minutes_degrees" with a speed of 360."

from hub import port
import motor
import random
import runloop

hours = random.randint(1, 12)
hour_degrees = hours * 30
minutes = random.randint(1, 60)
minutes_degrees = minutes * 6

async def main():
    motor.run_for_degrees(port.E, hour_degrees, 360)
    motor.run_for_degrees(port.F, minutes_degrees, -360)

runloop.run(main())

"Program the robot to wait 5 seconds after moving its arrows and then turn them back."

from hub import port
import motor
import random
import runloop

hours = random.randint(1, 12)
hour_degrees = hours * 30
minutes = random.randint(1, 60)
minutes_degrees = minutes * 6

async def main():
    motor.run_for_degrees(port.E, hour_degrees, 360)
    motor.run_for_degrees(port.F, minutes_degrees, -360)
    await runloop.sleep_ms(5000)
    motor.run_for_degrees(port.E, hour_degrees, -360)
    motor.run_for_degrees(port.F, minutes_degrees, 360)

runloop.run(main())

"Put it all together"

from hub import port, light_matrix
import motor
import random
import runloop

hours = random.randint(1, 12)
hour_degrees = hours * 30
minutes = random.randint(1, 60)
minutes_degrees = minutes * 6

async def main():
    motor.run_for_degrees(port.E, hour_degrees, 360)
    motor.run_for_degrees(port.F, minutes_degrees, -360)
    await runloop.sleep_ms(5000)
    motor.run_for_degrees(port.E, hour_degrees, -360)
    motor.run_for_degrees(port.F, minutes_degrees, 360)
    light_matrix.write(str(hours) + ":" + str(minutes))

runloop.run(main())