Buzzer is used as a sound warning element in many electronic systems. In this application we will see how to use the buzzer in addition to different projects.
Buzzer is an easy to understand circuit element. It has two pins.
We will connect one end to digital pin 2 of the Arduino board. We will connect the other end to GND.
We will send note signals to the buzzer with "tone" from Arduino codes. Below are the numerical values corresponding to each note.
We need to add a waiting period between the notes with the help of the "delay" command. Otherwise, the notes are incomprehensible.
Arduino codes are below: