/*
Make simple sounds
*/
// constants won't change. They're used here to
// set pin numbers:
// in Pin 12 we will connect the piezo speaker.
// Give it a name.
const int speakerPin = 12;
// the number of tones to play
const int numTones = 10;
// the tones to play
// mid C C# D D# E F F# G G# A
int tones[] = {261, 277, 294, 311, 330, 349, 370,
392, 415, 440};
// the setup routine runs once when you press
// reset:
void setup() {
for (int i = 0; i < numTones; i++) {
tone(speakerPin, tones[i]);
delay(500);
}
noTone(speakerPin);
}
// the loop routine runs over and over again
// forever:
void loop() {
}