diff --git a/docs/microbit_micropython_api.rst b/docs/microbit_micropython_api.rst index 19362fdac..93c2400b7 100644 --- a/docs/microbit_micropython_api.rst +++ b/docs/microbit_micropython_api.rst @@ -108,6 +108,8 @@ The Microphone is accessed via the `microphone` object:: set_threshold(128) # Returns a representation of the sound pressure level in the range 0 to 255. sound_level() + # Returns a representation of the sound pressure level in decibels (dB). + sound_level_db() Pins ---- diff --git a/docs/microphone.rst b/docs/microphone.rst index 3cc74c8e9..dc2edaa14 100644 --- a/docs/microphone.rst +++ b/docs/microphone.rst @@ -60,7 +60,7 @@ Functions * **event**: a sound event, such as ``SoundEvent.LOUD`` or ``SoundEvent.QUIET``. - + * **value**: The threshold level in the range 0-255. For example, ``set_threshold(SoundEvent.LOUD, 250)`` will only trigger if the sound is very loud (>= 250). @@ -70,6 +70,9 @@ Functions * **return**: a representation of the sound pressure level in the range 0 to 255. +.. py:function:: sound_level_db() + + * **return**: a representation of the sound pressure level in decibels (dB). Example =======