45 lines
813 B
Arduino
45 lines
813 B
Arduino
|
#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() {
|
|||
|
}
|
|||
|
|
|||
|
|