COSA
An Object-Oriented Platform for Arduino Programming
Tone.hh
Go to the documentation of this file.
1 
21 #ifndef COSA_TONE_HH
22 #define COSA_TONE_HH
23 
24 #include "Cosa/Types.h"
25 
69 class Tone {
70 public:
72  static const uint8_t VOLUME_MAX = 10;
73 
77  static void begin();
78 
87  static void play(uint16_t freq,
88  uint8_t volume = VOLUME_MAX / 2,
89  uint16_t duration = 0,
90  bool background = false);
91 
95  static void silent();
96 
97 private:
101  Tone();
102 
103  static uint32_t s_expires;
104  static const uint8_t s_map[] PROGMEM;
105  friend void TIMER1_COMPA_vect(void);
106 };
107 #endif
108 
static void play(uint16_t freq, uint8_t volume=VOLUME_MAX/2, uint16_t duration=0, bool background=false)
Definition: Tone.cpp:67
static const uint8_t VOLUME_MAX
Definition: Tone.hh:72
static void silent()
Definition: Tone.cpp:109
static void begin()
Definition: Tone.cpp:60
friend void TIMER1_COMPA_vect(void)
Definition: Tone.hh:69