Skip to content

shivaganesht/Arduino-Buzzer-Sound-Code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Arduino Buzzer Sound Code

This Arduino project demonstrates creating sound using a buzzer connected to the Arduino board. The buzzer will produce sound with intervals of five seconds.

Installation

  1. Clone this repository to your local machine using git clone https://github.com/shivaganesht/Arduino-Buzzer-Sound-Code.git
  2. Open the project in the Arduino IDE.

Usage

Buzzer

  1. Connect your Arduino board to your computer.
  2. Upload the code to your Arduino board.
  3. The buzzer connected to the built-in pin on the Arduino board will produce sound with intervals of five seconds.

Code Overview

void setup()
{
    pinMode(LED_BUILTIN, OUTPUT); // Set the built-in Buzzer pin as an output
}

void loop()
{
    digitalWrite(LED_BUILTIN, HIGH); // Turn the Buzzer Sound on
    delay(5000); // Wait for five seconds
    digitalWrite(LED_BUILTIN, LOW); // Turn the Buzzer Sound off
    delay(5000); // Wait for five seconds
}

If you want to change the duration of the sound intervals, you can modify the delay time in the code. The timing in the delay function is in milliseconds (i.e., 1 second = 1000 milliseconds).

Conclusion

This project provides a simple example of generating sound using a buzzer with Arduino. Feel free to modify the code to customize the sound intervals according to your requirements!

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages