doc/pupdevices: InfraredSensor, TiltSensor example

This commit is contained in:
Laurens Valk
2020-07-11 12:46:30 +02:00
parent 4dbaf5f68e
commit 19009d1637
2 changed files with 16 additions and 1 deletions
+15
View File
@@ -212,6 +212,14 @@ Infrared Sensor
.. figure:: ../api/images/sensor_proximity.png
:width: 35 %
.. toggle-header::
:header: **Show/hide example**
**Example: Measuring distance, object count, and reflection**
.. literalinclude::
../../pybricks-projects/snippets/pup/sensor_infrared/basics.py
.. autoclass:: pybricks.pupdevices.InfraredSensor
:no-members:
@@ -228,6 +236,13 @@ Tilt Sensor
.. figure:: ../api/images/sensor_tilt.png
:width: 35 %
.. toggle-header::
:header: **Show/hide example**
**Example: Measuring pitch and roll**
.. literalinclude::
../../pybricks-projects/snippets/pup/sensor_tilt/basics.py
.. autoclass:: pybricks.pupdevices.TiltSensor
:no-members: