Add the following snippet to your HTML:
Learn how to use the KY-012 module in seconds!
Read up about this project on
This is the simplest and quickest way how to use an active buzzer.
int buzzerPin = 8; void setup () { pinMode (buzzerPin, OUTPUT); } void loop () { digitalWrite (buzzerPin, HIGH); delay (500); digitalWrite (buzzerPin, LOW); delay (500); } //to use ky-012
Comments