#define NOTE_C4 262
const int buzzerpin = 8;
void setup()
{
pinMode(buzzerpin, OUTPUT);
}
void loop()
{
ourTone(NOTE_C4, 2000);
noTone(buzzerpin);
delay(2000);
}
void ourTone(int freq, int duration)
{
tone(buzzerpin, freq, duration);
delay(duration);
}