BuzzerManager is an Arduino library for controlling buzzers with flexible and non-blocking beep patterns. This library is ideal for projects that require independent control of multiple buzzers or specific beep sequences.
- Non-blocking: Does not use
delay(), allowing other tasks to run concurrently. - Flexible Patterns: Set the number of beeps, frequency, duration, and pause between beeps.
- Multi-Buzzer Support: Control multiple buzzers independently.
- Download the library files.
- Place the folder
BuzzerManagerin thelibrariesdirectory of your Arduino environment. - Restart the Arduino IDE.
#include <BuzzerManager.h>
const int buzzerPin = 9; // Pin connected to the buzzer
BuzzerManager buzzer(buzzerPin);buzzer.beep(5, 1000, 500, true); // Beep 5 times, 1 second duration, 0.5 second pause, buzzer onvoid loop() {
buzzer.update(); // Call this in the loop to manage buzzer state
}- Alarm Systems: Use multiple buzzers for different alarm signals.
- Toys: Create sound effects for interactive toys.
- Indicators: Use buzzers as indicators for various events in your project.