upm  0.5.1
Sensor/Actuator repository for libmraa (v0.9.1)
 All Data Structures Files Functions Variables 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.

grovespeaker.jpg
// Instantiate a Grove Speaker on digital pin D2
// Play all 7 of the lowest notes
speaker->playAll();
// 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

Parameters
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

Parameters
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: