semsemharaz
Published

Interfacing Buzzer with Arduino

In this project, we are going to learn how to interface buzzer with Arduino.

BeginnerProtip3,029
Interfacing Buzzer with Arduino

Things used in this project

Story

Read more

Schematics

Schematic for the project

Code

Code

C/C++
//* Interfacing buzzer with Arduino 
//* Author: Osama Ahmed 

int buzzer=10;                //Defining variable and the GPIO pin on Arduino
void setup() 
{
  pinMode(buzzer, OUTPUT);    //Defining the pin as OUTPUT
  //put your setup code here:
}

void loop() 
{

  digitalWrite(buzzer, HIGH);   //Setting the pin HIGH
  delay(2000);
  digitalWrite(buzzer, LOW);    //Setting the pin HIGH
  delay(2000);
  //put your main code here, to run repeatedly:
}

Credits

semsemharaz
6 projects • 1 follower
Contact

Comments

Please log in or sign up to comment.