Plan
Board
Made with Fritzing
Code
int pinSpeaker = 6;
int numTones = 6;
int tones[] = {261, 294, 330, 349, 392, 440};
// C D E F G A
void setup()
{
pinMode(pinSpeaker, OUTPUT);
}
void loop()
{
for (int i = 0; i < numTones; i++)
{
tone(pinSpeaker, tones[i]);
delay(500);
}
delay(3000);
}
Download
Fritzing: buzzer.fzz