upm  0.4.1
Sensor/Actuator repository for libmraa (v0.8.0)
Public Member Functions

API for the HT9170 DTMF Decoder. More...

Detailed Description

This driver was developed using the DTMF (Dual-Tone Multi-Frequency) Shield by Seeed Studio*. It can decode DTMF signals presented at its audio input. It does not generate DTMF signals.

ht9170.jpg
// Instantiate a DTMF decoder
upm::HT9170* dtmf = new upm::HT9170(12, 11, 10, 9, 8);
// Now we just spin in a loop, sleeping every 100ms, checking to see
// if a digit is available. If so, we decode and print the digit,
// and continue looping.
while(shouldRun)
{
if (dtmf->digitReady())
{
cout << "Got DTMF code: " << dtmf->decodeDigit() << endl;
// now spin until digitReady() goes false again
while (dtmf->digitReady())
;
}
usleep(100000);
}

Public Member Functions

 HT9170 (int dr, int o1, int o2, int o3, int o4)
 
 ~HT9170 ()
 
bool digitReady ()
 
char decodeDigit ()
 

Constructor & Destructor Documentation

HT9170 ( int  dr,
int  o1,
int  o2,
int  o3,
int  o4 
)

HT9170 constructor

Parameters
drData ready pin
o1Digital pin for data output 1
o2Digital pin for data output 2
o3Digital pin for data output 3
o4Digital pin for data output 4
~HT9170 ( )

HT9170 destructor

Member Function Documentation

bool digitReady ( )

Checks to see if a DTMF number is ready to be read

Returns
True if there is a digit available to decode
char decodeDigit ( )

Decodes a digit and returns it


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