doc/hubs: Add light examples

This commit is contained in:
Laurens Valk
2020-10-09 22:46:35 +02:00
parent a603c19d0e
commit 90bea73c11
4 changed files with 70 additions and 1 deletions
+23
View File
@@ -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
+23
View File
@@ -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
+23
View File
@@ -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