Buzzer Arduino Example Code

CEM-1203.jpg

I just received a small CEM-1203 buzzer from Spark Fun for an Arduino project with sound output. After writing up a basic function to run it, I decided to generalize and fully comment so that other people could use similar buzzers without having to think through the math each time they wanted to hear a particular sound frequency. All you need to do is tell the function which pin you’d like to use, the frequency you want to hear, and the duration to play that frequency.

My buzzer example function should easily work with other types of sound output devices.

5 thoughts on “Buzzer Arduino Example Code”

Comments are closed.

Scroll to Top