LEGO® BOOST Move Hub.
Using the hub status light
Turns on the light at the specified color.
color (Color) – Color of the light.
Turns off the light.
Blinks the light at a given color by turning it on and off for given durations.
The light keeps blinking indefinitely while the rest of your program keeps running.
This method provides a simple way to make basic but useful patterns. For more generic and multi-color patterns, use
Animates the light with a list of colors. The next color in the list is shown after the given interval.
The animation runs in the background while the rest of your program keeps running. When the animation completes, it repeats.
Using the battery
Gets the voltage of the battery.
- Return type
Status light examples¶
Turning the light on and off¶
from pybricks.hubs import MoveHub from pybricks.parameters import Color from pybricks.tools import wait # Initialize the hub. hub = MoveHub() # Turn the light on and off 5 times. for i in range(5): hub.light.on(Color.RED) wait(1000) hub.light.off() wait(500)