adafruit / Adafruit_CircuitPython_CircuitPlayground

CircuitPython library for Circuit Playground Express
MIT License
91 stars 71 forks source link

Sound_level not implemented for express #122

Closed mblahay closed 1 year ago

mblahay commented 1 year ago

Not so much an issue, rather a question. As I have found examples of code online to implement functionality something like sound_level, and the code seems very similar to that used in the blue fruit module; I am curious as to the reason sound_level is not implemented for express?

tekktrik commented 1 year ago

Unfortunately, the Express does not have the resources to support sound_level within CircuitPython. You can see this issue for more details.

mblahay commented 1 year ago

Help me understand, is there something about the size of the library that is problematic? or is it being said that the board as a whole cannot handle measuring sound levels?

dhalbert commented 1 year ago

The CPX can definitely measure sound levels. However, it's either that on some CPX builds the frozen library was too large or that the buffer required (320 bytes) sometimes caused a storage failure, perhaps in conjunction with other examples. You can extract the code you need from https://github.com/adafruit/Adafruit_CircuitPython_CircuitPlayground/blob/72b018d54240ae98e0ee1579923b8348146e249d/adafruit_circuitplayground/bluefruit.py#L78 or https://learn.adafruit.com/adafruit-circuit-playground-express/playground-sound-meter