Details
What's inside?
Discussion
Details
Overview
This breadboard-compatible active buzzer is perfect for generating sound in your projects. All pins are mirrored on each side for easier access, allowing you to connect as you wish.
- Easy Interface
- Arduino Compatible
- Digital Input
- Genesis Matrix Compatible
Documentation
This part is fully open sourced with schematics and 3D files available bellow
AXM0012
Step by step user guide
All Axiometa products come with user guides and setting up instructions
Connection Guide
Here you’ll find connection guide images to help you integrate the sensor with various development platforms.
×
Arduino Example Code
If you haven’t already, check out this tutorial to guide you through setting up the Arduino IDE for uploading and debugging your sketches, as well as installing libraries.
For this part, you won’t need to use a library.
Code copied!
const int buzzerPin = A0; // Pin connected to the buzzer
// Notes (in Hz) for the song
const int NOTE_E4 = 330;
const int NOTE_D4 = 294;
const int NOTE_C4 = 262;
const int NOTE_G3 = 196;
// Song melody and note durations (4 = quarter note, 8 = eighth note, etc.)
int melody[] = { NOTE_E4, NOTE_D4, NOTE_C4, NOTE_D4, NOTE_E4, NOTE_E4, NOTE_E4,
NOTE_D4, NOTE_D4, NOTE_D4, NOTE_E4, NOTE_G3, NOTE_G3 };
int noteDurations[] = { 4, 4, 4, 4, 4, 4, 2,
4, 4, 2, 4, 4, 2 };
void setup() {
// No setup required for the buzzer
}
void loop() {
for (int i = 0; i < sizeof(melody) / sizeof(melody[0]); i++) {
int duration = 1000 / noteDurations[i]; // Convert note duration to milliseconds
tone(buzzerPin, melody[i], duration); // Play the note on the buzzer
delay(duration * 1.3); // Pause between notes (1.3x duration for spacing)
noTone(buzzerPin); // Stop the tone
}
delay(100); // Delay before repeating the song
}
To see it working open serial monitor
MAC: CMD+Shift+M
Windows: CTRL+Shift+M
Related products
What's inside?
1x Active Buzzer (AXM0012)
Discussion
Add a review
Active Buzzer
Rating*
0/5
* Rating is required
Your review
* Review is required
Name
* Name is required
Email
* Email is required
0.0
Based on 0 reviews
5 star | 0% | |
4 star | 0% | |
3 star | 0% | |
2 star | 0% | |
1 star | 0% |
0 of 0 reviews
Sorry, no reviews match your current selections