Programming Examples

Arduino program to interface buzzer with Arduino board to buzz on off with the delay of 1sec


Blink or Glow Led when button press in Arduino

Write a program to interface buzzer with Arduino board to buzz on off with the delay of 1sec

const int BUZZER = 9;//buzzer to arduino pin 9
void setup()
{
  	pinMode(BUZZER, OUTPUT);// Set buzzer - pin 9 as an output
}
void loop()
{
  tone(BUZZER, 1000); // Send 1KHz sound signal...
	delay(1000);//for 1 sec
	noTone(BUZZER); //Stop sound...
	delay(1000); //..for 1sec 
}

Output


Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Best Website and Software Company in Allahabad