CP Bluefruit with synesthesia?
Posted: Sat Jan 21, 2023 4:07 pm
I've got a Circuit Playground Bluefruit (the older one), and I'm using Adafruit CircuitPython 7.3.3 on 2022-08-29
I've got some code that wants to do one thing if there is bright light, but a different thing if there is a loud sound.
However, bright lights register as high sound levels for some reason:
take this code as an example:
If I shine a bright light at it while there is silence this is the output I get:
I've verified that the light level does in fact react as well, but why are lights being registered as sounds?
Thanks,
Mitch
I've got some code that wants to do one thing if there is bright light, but a different thing if there is a loud sound.
However, bright lights register as high sound levels for some reason:
take this code as an example:
Code: Select all
import time
from adafruit_circuitplayground.bluefruit import cpb
while True:
if cpb.loud_sound():
print("Sound level {}".format(cpb.sound_level))
if cpb.light > 100:
print("Light level {}".format(cpb.light))
time.sleep(0.5)
Code: Select all
code.py output:
Sound level 231.024
Sound level 177.795
Sound level 478.971
Sound level 1096.87
Sound level 1575.9
Sound level 1826.04
Sound level 2235.47
Sound level 10361.6
Sound level 10794.2
Sound level 10250.9
Sound level 9472.67
Light level 298
Sound level 9128.71
Sound level 8716.05
Sound level 8697.88
Light level 302
Sound level 8416.74
Sound level 8695.8
Light level 50
Sound level 8979.71
Sound level 8582.29
Sound level 7360.84
Light level 224
Sound level 7396.22
Thanks,
Mitch