In this tutorial you will learn how to use a buzzer with Arduino. 17



F3DDJQ4IAP6UGTG.LARGE Upload the following sample sketch to make the Buzzer make a beeping noise:
#define buzzer 9 //connect Buzzer to digital pin9
void setup() {                
 // initialize the digital pin9 as an output.
 pinMode(buzzer, OUTPUT);     

void loop() {
 digitalWrite(buzzer, HIGH);   // set the Buzzer on
 delay(500);                  // for 500ms
 digitalWrite(buzzer, LOW);   // set the Buzzer off

You can get more info about buzzer: