2014-git-work/arduino/toneMelodyDisk0/toneMelodyDisk0.ino
2013-09-16 17:37:33 +09:00

44 lines
813 B
C++
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "pitches.h"
void disk0(){
/*
$pu1
l12 o5
c4f4b-4agfg8.g16
<c4e-4dc>b-<c4>a4b-4
f8.d16
$pu2
f2.
*/
int melodyDisk0[] = {
NOTE_C4, NOTE_F4, NOTE_AS4, NOTE_A4, NOTE_G4, NOTE_F4, NOTE_G4,
NOTE_C5, NOTE_DS5,NOTE_D5, NOTE_C5,NOTE_AS4,
NOTE_C5,NOTE_A4,NOTE_AS4,
NOTE_F4,NOTE_D4,NOTE_F4
};
// note durations: 4 = quarter note, 8 = eighth note, etc.:
int noteDurationsDisk0[] = {
4,4,4,11,11,11,4,
4,4,11,11,11,
4,4,4,
6,11,2
};
for (int thisNote = 0; thisNote < 19; thisNote++) {
int noteDuration = 1000/noteDurationsDisk0[thisNote];
tone(3, melodyDisk0[thisNote],noteDuration);
int pauseBetweenNotes = noteDuration * 1.30;
delay(pauseBetweenNotes);
noTone(3);
}
}
void setup(){
disk0();
}
void loop() {
}