upm
1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
|
API for the Grove Speaker. More...
UPM module for the Grove Speaker. This sensor can generate different tones and sounds depending on the frequency of the input signal.
Public Member Functions | |
GroveSpeaker (int pin) | |
~GroveSpeaker () | |
void | playAll () |
void | playSound (char letter, bool sharp, std::string vocalWeight) |
GroveSpeaker | ( | int | pin | ) |
~GroveSpeaker | ( | ) |
GroveSpeaker destructor
void playAll | ( | ) |
Plays all alto notes (lowest notes)
void playSound | ( | char | letter, |
bool | sharp, | ||
std::string | vocalWeight | ||
) |
Plays a sound and a note whether it's sharp or not
letter | Character name of the note ('a', 'b', 'c', 'd', 'e', 'f', or 'g') |
sharp | If true, plays a sharp version of the note; otherwise, does not play the note |
vocalWeight | String to determine whether to play a low ("low"), a medium ("med"), or a high ("high") note |