mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-15 11:04:55 +00:00
These code samples are rendered in the docs, so we include them here. For the git history of these snippets, see: https://github.com/pybricks/pybricks-projects/commits/f4914069aaacfd9ab1e0dd6f05524f62cfc56b29/snippets
17 lines
319 B
Python
17 lines
319 B
Python
from pybricks.hubs import MoveHub
|
|
from pybricks.parameters import Color
|
|
from pybricks.tools import wait
|
|
|
|
# Initialize the hub.
|
|
hub = MoveHub()
|
|
|
|
# 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)
|