mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-12 01:24:17 +00:00
Instead of saying that some lines should be skipped, just say for which hubs the entire script will work.
17 lines
336 B
Python
17 lines
336 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()
|
|
|
|
# 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)
|