Professional Documents
Culture Documents
*/
// Sets up the song length, which is the total number of notes and spaces
char notes[] = "d ccc ggg BGfdc "; // a space represents a rest
void setup()
{
pinMode(13, OUTPUT);
pinMode(12, OUTPUT);
pinMode(11, OUTPUT);
pinMode(10, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(buzzerpin, OUTPUT);
}
void loop()
{
int i, duration;
for (i = 0; i < songLength; i++) // step through the song arrays
{
duration = beats[i] * tempo; // length of note or rest in milliseconds
int i;
const int numNotes = 6; // number of different notes in the song.
// The following arrays show what the frequency is for each note.