Hello!
I’m trying to play tones on the Grove Speaker Plus via FRDM K64F. The speaker is connected to the D3 pin on the Grove base shield and I’m attempting to use PwmOut.
However, the tone is very high and feeble even when I set the duty cycle to 50% (max volume).
Code:
PwmOut spkr(D3);
In main -
while(1) {
spkr.period(1.0/500.0); // 500hz period
spkr =0.5; //50% duty cycle - max volume
wait(3);
spkr=0.0; // turn off audio
wait(2);
}
Any solutions?
Thank you!