api/pupdevices: add UltrasonicSensor

Initial class without any methods for the SPIKE Ultrasonic Sensor
This commit is contained in:
Laurens Valk
2020-05-27 13:58:30 +02:00
committed by laurensvalk
parent 10b6808037
commit e67c048b18
2 changed files with 32 additions and 1 deletions
+26 -1
View File
@@ -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
.. ^^^^^^^^^^^^^^^^^^^^^^^^^
+6
View File
@@ -142,3 +142,9 @@ class ColorSensor:
"""LEGO® SPIKE Color Sensor."""
lights = _LightArray(3)
class UltrasonicSensor:
"""LEGO® SPIKE Color Sensor."""
lights = _LightArray(3)