From 90bea73c11bd677676aa976c7fd30643f0d779f8 Mon Sep 17 00:00:00 2001 From: Laurens Valk Date: Fri, 9 Oct 2020 22:46:35 +0200 Subject: [PATCH] doc/hubs: Add light examples --- doc/api/hubs_cityhub.inc | 23 +++++++++++++++++++++++ doc/api/hubs_movehub.inc | 23 +++++++++++++++++++++++ doc/api/hubs_technichub.inc | 23 +++++++++++++++++++++++ pybricks-projects | 2 +- 4 files changed, 70 insertions(+), 1 deletion(-) diff --git a/doc/api/hubs_cityhub.inc b/doc/api/hubs_cityhub.inc index 09d349d..cb27a8e 100644 --- a/doc/api/hubs_cityhub.inc +++ b/doc/api/hubs_cityhub.inc @@ -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 diff --git a/doc/api/hubs_movehub.inc b/doc/api/hubs_movehub.inc index 233470a..2200007 100644 --- a/doc/api/hubs_movehub.inc +++ b/doc/api/hubs_movehub.inc @@ -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 diff --git a/doc/api/hubs_technichub.inc b/doc/api/hubs_technichub.inc index cb9af47..8fdea40 100644 --- a/doc/api/hubs_technichub.inc +++ b/doc/api/hubs_technichub.inc @@ -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 diff --git a/pybricks-projects b/pybricks-projects index 2a08462..86587ee 160000 --- a/pybricks-projects +++ b/pybricks-projects @@ -1 +1 @@ -Subproject commit 2a08462af1998646e567de98dac4d43b18e66138 +Subproject commit 86587eeff221c955593c89f5f9233dfde9d96f7e