KY-012 Active Buzzer Module
The KY-012 Active Buzzer Module. The module consists of an active piezoelectric buzzer, it generates a sound of aproximately 2.5kHz when signal is high.
Connection
Connect signal (S) to pin 8 on the Arduino and Ground (-) to GND.
KY-012 | Arduino |
S | Pin 8 |
– | GND |
Code
//Example code KY012 active buzzer
int speakerPin = 8;
void setup () {
pinMode (speakerPin, OUTPUT);
}
void loop () {
analogWrite (speakerPin, 255);
delay (50);
analogWrite (speakerPin, 0);
delay (10);
}
Links
37 in 1 box Sensor Kit For Arduino Starters brand in stock
Comments are closed, but trackbacks and pingbacks are open.