Comments
Login to post a comment...
Piezoelectric speakers are frequently used as beepers in watches and other electronic devices. In this project, a piezo speaker is used to play melodies. It sends a square wave of the appropriate frequency to the piezo, generating the corresponding tone.
|
Connect the red wire of a piezo speaker to Arduino's PWM pin 9, and the black wire to ground. Use the Arduino code "Melody" to play different notes. |
ImagesFilesLinks |
JordanArduino # July 27, 2011, 10:20 p.m.
i tried it with leds and it works