mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-15 11:04:55 +00:00
api/pupdevices: add UltrasonicSensor
Initial class without any methods for the SPIKE Ultrasonic Sensor
This commit is contained in:
committed by
laurensvalk
parent
10b6808037
commit
e67c048b18
+26
-1
@@ -121,6 +121,8 @@ Color Sensor
|
||||
|
||||
.. todo:: Support for this sensor is not yet implemented. API is experimental.
|
||||
|
||||
Add image with numbered labels for light index
|
||||
|
||||
.. figure:: ../api/images/sensor_color.png
|
||||
:width: 35 %
|
||||
|
||||
@@ -129,7 +131,7 @@ Color Sensor
|
||||
|
||||
.. rubric:: Built-in lights
|
||||
|
||||
This sensor has a 3 built-in lights. You can adjust the brightness of each
|
||||
This sensor has 3 built-in lights. You can adjust the brightness of each
|
||||
light. If you use the sensor to measure something afterwards, the light
|
||||
automatically turns back on as needed for the measurement.
|
||||
|
||||
@@ -138,6 +140,29 @@ Color Sensor
|
||||
.. automethod:: pybricks.pupdevices::ColorSensor.lights.off
|
||||
|
||||
|
||||
Ultrasonic Sensor
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. todo:: Support for this sensor is not yet implemented. API is experimental.
|
||||
|
||||
Flip image to ensure top/bottom left/right description is correct
|
||||
|
||||
.. figure:: ../api/images/sensor_ultrasonic.png
|
||||
:width: 35 %
|
||||
|
||||
.. autoclass:: pybricks.pupdevices.UltrasonicSensor
|
||||
:no-members:
|
||||
|
||||
.. rubric:: Built-in lights
|
||||
|
||||
This sensor has 4 built-in lights. You can adjust the brightness of each
|
||||
light.
|
||||
|
||||
.. automethod:: pybricks.pupdevices::UltrasonicSensor.lights.on
|
||||
|
||||
.. automethod:: pybricks.pupdevices::UltrasonicSensor.lights.off
|
||||
|
||||
|
||||
.. Tilt Sensor
|
||||
.. ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
||||
@@ -142,3 +142,9 @@ class ColorSensor:
|
||||
"""LEGO® SPIKE Color Sensor."""
|
||||
|
||||
lights = _LightArray(3)
|
||||
|
||||
|
||||
class UltrasonicSensor:
|
||||
"""LEGO® SPIKE Color Sensor."""
|
||||
|
||||
lights = _LightArray(3)
|
||||
|
||||
Reference in New Issue
Block a user