I just received my new CLUE today and noticed the speaker is barely audible. I'm pretty confident that's not right -- I have a CircuitPlayground_Express and it is MUCH louder. Here is CircuitPython code that will run on either board (just comment in or out the first two lines). The tone played is quite loud on the CPX and barely audible on the CLUE (have to strain to hear it at all). Note as a check I also computed the RMS of the sine wave sample on both boards just to check if the two libraries were using different waveforms. The RMS is the same on both, so no.
Perhaps my CLUE board is defective?
Mike
Code: Select all
#from adafruit_circuitplayground.express import cpx as brd
from adafruit_clue import clue as brd
import time, math
def rms(xs):
mn = sum(xs) / len(xs)
smsq = sum((x - mn) * (x - mn) for x in xs)
return math.sqrt(smsq) / len(xs)
brd.start_tone(550)
time.sleep(1)
print("wave RMS", rms(brd._sine_wave))
brd.stop_tone()