mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-11 09:05:07 +00:00
16 lines
339 B
Python
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)
|