#pragma once #include class MusicPlayer { public: MusicPlayer(uint8_t pin); /** Play begins playing a tune */ void Play(int bpm, const char *tune); /** KeepPlaying should be called once per loop. * It returns true if a tune is currently being played. */ bool KeepPlaying(); /** Tone plays a certain tone */ void Tone(int note); /** NoTone stops playing anything */ void NoTone(); private: uint8_t pin; char *tune; unsigned long nextNoteMillis; uint16_t baseDuration; }; #define TUNE_STAYIN_ALIVE "E- F _ A- P2 E-2 P2 C P