Mini Speaker

You can make your circuit playground sing with the built in buzzer. This is a miniature magnetic speaker connected to digital pin #5 with a transistor driver. It is quite small but can beep with conviction! It's not good for playing detailed audio, more for beeping and buzzing and simple bleepy tunes.

The driver circuitry is an on/off transistor driver, so you will only be able to play square waves. It is also not the same loudness over all frequencies but is designed to be the loudest at around 4 KHz. See the datasheet for some more details

Library Reference

You can play basic square wave beeps/tones with CircuitPlayground.playTone(frequency, duration_ms). Where frequency is the frequency in Hertz and duration is the time to play the beep for, in millisecods.

That means CircuitPlayground.playTone(440, 500) will play 440 Hz (middle A) for 500 milliseconds (half of a second). The call will take the amount of time that it takes to play the tone, so if you have a duration of, say, 5000 milliseconds your Circuit Playground will spend 5 seconds playing a tone and won't be doing anything else.

Last updated on 2016-07-18 at 10.23.01 PM Published on 2016-07-19 at 08.31.23 PM