Skip to content

Commit e0f97f6

Browse files
docs: Add microphone.sound_level_db() function.
1 parent acee09a commit e0f97f6

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

docs/microbit_micropython_api.rst

+2
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ The Microphone is accessed via the `microphone` object::
108108
set_threshold(128)
109109
# Returns a representation of the sound pressure level in the range 0 to 255.
110110
sound_level()
111+
# Returns a representation of the sound pressure level in decibels (dB).
112+
sound_level_db()
111113

112114
Pins
113115
----

docs/microphone.rst

+4-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Functions
6060
6161
* **event**: a sound event, such as ``SoundEvent.LOUD`` or
6262
``SoundEvent.QUIET``.
63-
63+
6464
* **value**: The threshold level in the range 0-255. For example,
6565
``set_threshold(SoundEvent.LOUD, 250)`` will only trigger if the sound is
6666
very loud (>= 250).
@@ -70,6 +70,9 @@ Functions
7070
* **return**: a representation of the sound pressure level in the range 0 to
7171
255.
7272

73+
.. py:function:: sound_level_db()
74+
75+
* **return**: a representation of the sound pressure level in decibels (dB).
7376

7477
Example
7578
=======

0 commit comments

Comments
 (0)