Turn-key PCB assembly services in prototype quantities or low-volume to mid-volume production runs

PIC16 plays music notes

You’ve probably seen postcards where you open them and it starts playing “Happy Birthday” tune. This is really easy when you know how. Embedded lab shows how to do this with PIC16F628A microcontroller and buzzer. Buzzer is connected via transistor switch and this is all setup needed.

The idea of generating sound here is simple. All you need is to have note frequencies that are stored in array. And for note duration there are another array. According to that data microcontroller simply generates square wave and so you hear a sound. As Christmas not far away you can start putting “Merry Christmas” song.

[..Source link..]

Bookmark the permalink.

Leave a Reply