mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-12 09:37:25 +00:00
Now that each device is on its own page, we no longer need to collapse snippets to reduce page size. Now they can just all be at the bottom of the page. This also gives each a dedicated link which is easier when giving support.
24 lines
573 B
ReStructuredText
24 lines
573 B
ReStructuredText
Infrared Sensor
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
.. figure:: ../../api/images/sensor_proximity.png
|
|
:width: 35 %
|
|
|
|
.. autoclass:: pybricks.pupdevices.InfraredSensor
|
|
:no-members:
|
|
|
|
.. automethod:: pybricks.pupdevices.InfraredSensor.distance
|
|
|
|
.. automethod:: pybricks.pupdevices.InfraredSensor.reflection
|
|
|
|
.. automethod:: pybricks.pupdevices.InfraredSensor.count
|
|
|
|
Examples
|
|
-------------------
|
|
|
|
Measuring distance, object count, and reflection
|
|
************************************************
|
|
|
|
.. literalinclude::
|
|
../../../examples/pup/sensor_infrared/basics.py
|