Files
pybricks-api/examples/pup/hub_common/light_off.py
T
Laurens Valk 1b51d71061 examples: Generate hub examples while building.
This way we don't have to commit the generated scripts.

While we do this, rename ExampleHub to ThisHub so that the common scripts can actually run.
2022-07-04 14:29:33 +02:00

17 lines
340 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)