pxt-microbit icon indicating copy to clipboard operation
pxt-microbit copied to clipboard

Microphone level maxes out at ~191 on hardware

Open microbit-mark opened this issue 4 years ago • 4 comments

Writing the value of sound level to serial, the loudest sound level returned seems to be between 191-195. The returned level should be up to 255

image

https://makecode.microbit.org/_LMvK17UKMaeA

Does not reproduce in MicroPython, so I assume this is MakeCode related, not CODAL.

microbit-mark avatar Sep 23 '21 13:09 microbit-mark

@abchatra can you take a look at this one and try and reproduce?

microbit-mark avatar Nov 23 '21 12:11 microbit-mark

Does this not reproduce in python when writing to serial? Does this reproduce if we don't write to serial but just displayed on the screen?

I will take a look.

abchatra avatar Dec 05 '21 23:12 abchatra

@microbit-carlos do you think this is still an issue?

jaustin avatar Jan 30 '24 16:01 jaustin

This was fixed in CODAL in:

  • https://github.com/lancaster-university/codal-microbit-v2/issues/225

As part of that MakeCode should have been updated to use uBit.audio.levelSPL->setUnit(LEVEL_DETECTOR_SPL_8BIT) as described in https://github.com/lancaster-university/codal-microbit-v2/issues/225#issuecomment-1241023894, which I think it might not have been implemented yet: https://github.com/microsoft/pxt-microbit/blob/v6.1.8/libs/microphone/microphone.cpp

microbit-carlos avatar Jan 30 '24 18:01 microbit-carlos