mirror of
https://github.com/taigrr/arduinolibs
synced 2025-01-18 04:33:12 -08:00
20 lines
352 B
C++
20 lines
352 B
C++
#include <Melody.h>
|
|
|
|
int notes[] = {
|
|
NOTE_C4, NOTE_G3, NOTE_G3, NOTE_A3, NOTE_G3,
|
|
NOTE_REST, NOTE_B3, NOTE_C4, NOTE_REST
|
|
};
|
|
byte lengths[] = {4, 8, 8, 4, 4, 4, 4, 4, 2};
|
|
|
|
Melody melody(8);
|
|
|
|
void setup() {
|
|
melody.setMelody(notes, lengths, sizeof(lengths));
|
|
melody.setLoopCount(3);
|
|
melody.play();
|
|
}
|
|
|
|
void loop() {
|
|
melody.run();
|
|
}
|