Files
pybricks-api/examples/pup/hub_common/light_off.py
T
2026-08-24 09:28:29 +02:00

16 lines
339 B
Python

# ThisHub = MoveHub CityHub TechnicHub PrimeHub EssentialHub
from pybricks.hubs import ThisHub
from pybricks.parameters import Color
from pybricks.tools import wait
# Initialize the hub.
hub = ThisHub()
# 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)