Interfacing KY006(Passive Buzzer) with Arduino

 Interfacing KY006(Passive Buzzer) with  Arduino




Sketch for Police Alarm

int passive_buzzer = 11;

void setup() {

  pinMode (passive_buzzer, OUTPUT);

}


void loop() {

for (int i=0;i<250; i++)

{

  digitalWrite(passive_buzzer,HIGH);

  delay(1);

  digitalWrite(passive_buzzer,LOW);

  delay(1);

}

for (int i=0;i<125; i++)

{

  digitalWrite(passive_buzzer,HIGH);

  delay(2);

  digitalWrite(passive_buzzer,LOW);

  delay(2);


Comments

Popular posts from this blog

4 Stage Timer With DS3231RTC Module.

Interfacing KY038 sound sensor with Raspberry pi Pico

Interfacing MQ2 Gas & Smoke Sensor With Raspberry Pi Pico