Hi!
I'm playing with DTMF tones, using a MT8870 I decode tones to digital signals (binary code) and with some arduino code I parse it.
At this moment my loop function is:
void loop() {
irqState = digitalRead(STD); //Get the first trigger tone
if (irqState == 1) {
char code = mapKey();
Serial.println(code);
delay(100);
}
}
The thing is: I receive each decoded tone by triggering the irqState, So if I send 123 (three tones) I get 123, that is very nice!!! But now I want to 'store' it into an array to compare it later (to do some remote control stuff).
//Lets say you have an array:
char dtmf [20]
int i = 0;
setup()
//some code
loop()
{
// some code
irqState = digitalRead(STD); //Get the first trigger tone
if (irqState == 1)
{
dtmf[++i]= mapKey();
delay(100);
}
// lets say an # starts iteration code thought dtmf[0] to dtmf[maximum] to process through the values
// don't forget to set i = 0 when you are ready to start capturing again.
} // END of loop