100 #define NOTE_AS6 1865
103 #define NOTE_CS7 2217
105 #define NOTE_DS7 2489
108 #define NOTE_FS7 2960
110 #define NOTE_GS7 3322
112 #define NOTE_AS7 3729
115 #define NOTE_CS8 4435
117 #define NOTE_DS8 4978
137 void setMelody(
const int *notes,
const uint8_t *lengths,
unsigned int size);
147 const uint8_t *lengths;
150 unsigned long duration;
151 unsigned long startNote;
void setMelody(const int *notes, const uint8_t *lengths, unsigned int size)
Sets the melody to the size elements of notes and lengths.
void stop()
Stops playing the melody.
void run()
Runs the melody control loop.
bool isPlaying() const
Returns true if the melody is currently playing; false if not.
void playOnce()
Plays the melody once and then stops.
Melody(uint8_t pin)
Constructs a new melody playing object for pin.
int loopCount() const
Returns the number of times the melody should loop before stopping.
Plays a melody on a digital output pin using tone().
void setLoopDuration(unsigned long ms)
Sets the maximum number of loops to last no longer than ms milliseconds.
void play()
Starts playing the melody, or restarts it if already playing.
void setLoopCount(int count)
Sets the number of times the melody should loop to count.