Maze_Solver  1.0
A Maze Solver Algorithm for BotnRoll ONE A
Music.h
Go to the documentation of this file.
1 #ifndef MUSIC_H
2 #define MUSIC_H
3 
4 #include "Pitches.h"
5 
6 // notes in the melody:
8 
9 // note durations: 4 = quarter note, 8 = eighth note, etc.:
10 int noteDurations[] = { 4, 8, 8, 4, 4, 4, 4, 4 };
11 
13 {
14  // iterate over the notes of the melody:
15  for (int thisNote = 0; thisNote < 8; thisNote++)
16  {
17  int noteDuration = 1000/noteDurations[thisNote];
18  tone(9, melody[thisNote],noteDuration);
19  int pauseBetweenNotes = noteDuration * 1.30;
20  delay(pauseBetweenNotes);
21  noTone(9); // stop the tone playing:
22  }
23 }
24 
25 #endif
int noteDurations[]
Definition: Music.h:10
#define NOTE_C4
Definition: Pitches.h:44
#define NOTE_A3
Definition: Pitches.h:41
#define NOTE_G3
Definition: Pitches.h:39
void finishMusic()
Definition: Music.h:12
#define NOTE_B3
Definition: Pitches.h:43
int melody[]
Definition: Music.h:7