In this section, we will learn how to use a Piezo Buzzer and make sounds using some in-built C functions. A Piezo Buzzer is like a small speaker capable of emitting sounds at various frequencies. A typical Piezo Buzzer is shown in the following figure:
A Piezo Buzzer has two legs, one longer positive leg and one shorter negative leg. The negative leg is connected to the ground while the longer positive leg is usually connected to an Arduino pin via a 100 Ohms resistor.