Tweak order. Add comments.
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
+# Circuit Playground Sound Meter
+
import array
import math
import audiobusio
import board
import neopixel
+# Color of the peak pixel.
PEAK_COLOR = (100, 0, 255)
+# Number of total pixels - 10 build into Circuit Playground
NUM_PIXELS = 10
-# Number of samples to read at once.
-NUM_SAMPLES = 160
-
# Exponential scaling factor.
# Should probably be in range -10 .. 10 to be reasonable.
CURVE = 2
SCALE_EXPONENT = math.pow(10, CURVE * -0.1)
+# Number of samples to read at once.
+NUM_SAMPLES = 160
+
# Restrict value to be between floor and ceiling.
def constrain(value, floor, ceiling):
