Files
pybricks-api/examples/pup/hub_shared/light_blink.py
T
Laurens Valk 018b0d8b9d examples: simplify hub script generator
Instead of saying that some lines should be skipped, just say for which hubs the entire script will work.
2021-01-20 10:56:21 +01:00

18 lines
395 B
Python

# ExampleHub = MoveHub CityHub TechnicHub PrimeHub
from pybricks.hubs import ExampleHub
from pybricks.parameters import Color
from pybricks.tools import wait
# Initialize the hub
hub = ExampleHub()
# Keep blinking red on and off.
hub.light.blink(Color.RED, [500, 500])
wait(10000)
# Keep blinking green slowly and then quickly.
hub.light.blink(Color.GREEN, [500, 500, 50, 900])
wait(10000)