mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-15 02:54:52 +00:00
doc/hubs: Add light examples
This commit is contained in:
@@ -3,6 +3,29 @@
|
||||
|
||||
.. rubric:: Using the hub status light
|
||||
|
||||
.. toggle-header::
|
||||
:header: **Show/hide examples**
|
||||
|
||||
**Example 1: Turning the light on and off**
|
||||
|
||||
.. literalinclude::
|
||||
../../pybricks-projects/snippets/pup/hub_cityhub/light_off.py
|
||||
|
||||
**Example 2: Changing brightness and using custom colors**
|
||||
|
||||
.. literalinclude::
|
||||
../../pybricks-projects/snippets/pup/hub_cityhub/light_hsv.py
|
||||
|
||||
**Example 3: Making the light blink**
|
||||
|
||||
.. literalinclude::
|
||||
../../pybricks-projects/snippets/pup/hub_cityhub/light_blink.py
|
||||
|
||||
**Example 4: Creating light animations**
|
||||
|
||||
.. literalinclude::
|
||||
../../pybricks-projects/snippets/pup/hub_cityhub/light_animate.py
|
||||
|
||||
.. automethod:: pybricks.hubs::CityHub.light.on
|
||||
|
||||
.. automethod:: pybricks.hubs::CityHub.light.off
|
||||
|
||||
@@ -3,6 +3,29 @@
|
||||
|
||||
.. rubric:: Using the hub status light
|
||||
|
||||
.. toggle-header::
|
||||
:header: **Show/hide examples**
|
||||
|
||||
**Example 1: Turning the light on and off**
|
||||
|
||||
.. literalinclude::
|
||||
../../pybricks-projects/snippets/pup/hub_movehub/light_off.py
|
||||
|
||||
**Example 2: Changing brightness and using custom colors**
|
||||
|
||||
.. literalinclude::
|
||||
../../pybricks-projects/snippets/pup/hub_movehub/light_hsv.py
|
||||
|
||||
**Example 3: Making the light blink**
|
||||
|
||||
.. literalinclude::
|
||||
../../pybricks-projects/snippets/pup/hub_movehub/light_blink.py
|
||||
|
||||
**Example 4: Creating light animations**
|
||||
|
||||
.. literalinclude::
|
||||
../../pybricks-projects/snippets/pup/hub_movehub/light_animate.py
|
||||
|
||||
.. automethod:: pybricks.hubs::MoveHub.light.on
|
||||
|
||||
.. automethod:: pybricks.hubs::MoveHub.light.off
|
||||
|
||||
@@ -3,6 +3,29 @@
|
||||
|
||||
.. rubric:: Using the hub status light
|
||||
|
||||
.. toggle-header::
|
||||
:header: **Show/hide examples**
|
||||
|
||||
**Example 1: Turning the light on and off**
|
||||
|
||||
.. literalinclude::
|
||||
../../pybricks-projects/snippets/pup/hub_technichub/light_off.py
|
||||
|
||||
**Example 2: Changing brightness and using custom colors**
|
||||
|
||||
.. literalinclude::
|
||||
../../pybricks-projects/snippets/pup/hub_technichub/light_hsv.py
|
||||
|
||||
**Example 3: Making the light blink**
|
||||
|
||||
.. literalinclude::
|
||||
../../pybricks-projects/snippets/pup/hub_technichub/light_blink.py
|
||||
|
||||
**Example 4: Creating light animations**
|
||||
|
||||
.. literalinclude::
|
||||
../../pybricks-projects/snippets/pup/hub_technichub/light_animate.py
|
||||
|
||||
.. automethod:: pybricks.hubs::TechnicHub.light.on
|
||||
|
||||
.. automethod:: pybricks.hubs::TechnicHub.light.off
|
||||
|
||||
+1
-1
Submodule pybricks-projects updated: 2a08462af1...86587eeff2
Reference in New Issue
Block a user