From 477c214ed952927cb8ca3e1a331144b461f28036 Mon Sep 17 00:00:00 2001 From: Carlos Pereira Atencio Date: Thu, 21 Mar 2024 12:13:45 +0000 Subject: [PATCH] docs: Add microphone.sound_level_db() function. --- docs/microbit_micropython_api.rst | 2 ++ docs/microphone.rst | 4 ++++ 2 files changed, 6 insertions(+) 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 88a847031..f26a68e0e 100644 --- a/docs/microphone.rst +++ b/docs/microphone.rst @@ -91,6 +91,10 @@ 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) + in the range of 52.0 to 110.0 dB. Example =======