const int c = 261; const int d = 294; const int buzzerPin = 8; void setup() { pinMode(buzzerPin, OUTPUT); } void loop() { test(); delay(1000); } void beep(int note, int duration) { tone(buzzerPin, note, duration); } void test() { beep(c, 500); delay(1000); beep(d,500); }