upm  1.3.0
Sensor/Actuator repository for libmraa (v1.7.0)
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Public Member Functions
GroveSpeaker Class Reference

API for the Grove Speaker. More...

Detailed Description

UPM module for the Grove Speaker. This sensor can generate different tones and sounds depending on the frequency of the input signal.

// Instantiate a Grove Speaker on digital pin D2
// Play all 7 of the lowest notes
// Play a medium C-sharp
speaker->playSound('c', true, "med");

Public Member Functions

 GroveSpeaker (int pin)
 ~GroveSpeaker ()
void playAll ()
void playSound (char letter, bool sharp, std::string vocalWeight)

Constructor & Destructor Documentation

GroveSpeaker ( int  pin)

Grove Speaker constructor

pinDigital pin to use

GroveSpeaker destructor

Member Function Documentation

void playAll ( )

Plays all alto notes (lowest notes)

Here is the call graph for this function:

void playSound ( char  letter,
bool  sharp,
std::string  vocalWeight 

Plays a sound and a note whether it's sharp or not

letterCharacter name of the note ('a', 'b', 'c', 'd', 'e', 'f', or 'g')
sharpIf true, plays a sharp version of the note; otherwise, does not play the note
vocalWeightString to determine whether to play a low ("low"), a medium ("med"), or a high ("high") note

Here is the caller graph for this function:

The documentation for this class was generated from the following files: