Devices & Components
Arduino Uno Rev3
Buzzer
Breadboard (generic)
Jumper wires (generic)
Software & Tools
Arduino IDE
Project description
Code
Code
c_cpp
1//* Interfacing buzzer with Arduino 2//* Author: Osama Ahmed 3 4int buzzer=10; //Defining variable and the GPIO pin on Arduino 5void setup() 6{ 7 pinMode(buzzer, OUTPUT); //Defining the pin as OUTPUT 8 //put your setup code here: 9} 10 11void loop() 12{ 13 14 digitalWrite(buzzer, HIGH); //Setting the pin HIGH 15 delay(2000); 16 digitalWrite(buzzer, LOW); //Setting the pin HIGH 17 delay(2000); 18 //put your main code here, to run repeatedly: 19} 20
Code
c_cpp
1//* Interfacing buzzer with Arduino 2//* Author: Osama Ahmed 3 4int 5 buzzer=10; //Defining variable and the GPIO pin on Arduino 6void 7 setup() 8{ 9 pinMode(buzzer, OUTPUT); //Defining the pin as OUTPUT 10 11 //put your setup code here: 12} 13 14void loop() 15{ 16 17 digitalWrite(buzzer, 18 HIGH); //Setting the pin HIGH 19 delay(2000); 20 digitalWrite(buzzer, LOW); 21 //Setting the pin HIGH 22 delay(2000); 23 //put your main code here, to 24 run repeatedly: 25} 26
Downloadable files
Schematic for the project
Schematic for the project

Comments
Only logged in users can leave comments