api/nxtdevices: add Sound Sensor

This commit is contained in:
Laurens Valk
2020-01-14 20:16:10 +01:00
parent 7b7b69a141
commit aed3823af1
2 changed files with 30 additions and 0 deletions
+3
View File
@@ -43,3 +43,6 @@ NXT Ultrasonic Sensor
^^^^^^^^^^^^^^^^^^^^^
.. autoclass:: pybricks.nxtdevices.UltrasonicSensor
NXT Sound Sensor
^^^^^^^^^^^^^^^^^^^^^
.. autoclass:: pybricks.nxtdevices.SoundSensor
+27
View File
@@ -120,3 +120,30 @@ class UltrasonicSensor():
"""
pass
class SoundSensor():
"""LEGO® MINDSTORMS® NXT Sound Sensor."""
def __init__(self, port):
"""
Arguments:
port (Port): Port to which the sensor is connected.
"""
pass
def intensity(self, audible=True):
"""Measure the ambient sound intensity (loudness).
Arguments:
audible (bool): Detect only audible sounds. This tries to
filter out frequencies that cannot be heard by the
human ear. (*Default*: True).
Returns:
:ref:`percentage`: Sound intensity.
"""
pass