mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-11 09:05:07 +00:00
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.
23 lines
451 B
Python
23 lines
451 B
Python
# ThisHub = CityHub TechnicHub PrimeHub EssentialHub
|
|
from pybricks.hubs import ThisHub
|
|
from pybricks.parameters import Color
|
|
from pybricks.tools import wait
|
|
|
|
# Initialize the hub.
|
|
hub = ThisHub()
|
|
|
|
# Show the color at 30% brightness.
|
|
hub.light.on(Color.RED * 0.3)
|
|
|
|
wait(2000)
|
|
|
|
# Use your own custom color.
|
|
hub.light.on(Color(h=30, s=100, v=50))
|
|
|
|
wait(2000)
|
|
|
|
# Go through all the colors.
|
|
for hue in range(360):
|
|
hub.light.on(Color(hue))
|
|
wait(10)
|