I can’t seem to get the speaker to sound after hooking it up.
I think the PWM pins default to 490Hz and my speaker is rated for 800Hz-7000Hz. I don’t think that’s a major problem though because I connected the speaker and powered it using a function generator that outputted a square wave with a 490Hz frequency and that seemed to work fine.
Do you guys have any suggestions on what I should do and what I did wrong?
Analog pin isn’t PWM. Look on your board, for UNO PWM on digitals outputs # 3, 5,6,9,10 and 11.
And connect resistor in series with speaker, 120 Ohm or so, to prevent damage of microprocessor.
Magician:
Analog pin isn't PWM. Look on your board, for UNO PWM on digitals outputs # 3, 5,6,9,10 and 11.
And connect resistor in series with speaker, 120 Ohm or so, to prevent damage of microprocessor.