All,
Sorry I wasn't more clear. When I was asking questions, I was messing around with the code at the same time.
Well I tried the look up table method of function pointers and can't seem to get it to work although I though I knew how it did. For some reason, my compiler wants a ';' in front of
Code:
struct MyFunctionTable FunctionTable[]={{"Hello", &myHello}, {"GoodBye", &myGoodBye}};
I did that and it said "illegal initialization".
I have a code that reads sections of text to the user.
Instead of just reading the sentences one after another, I would like the program to have the ability of sampling the microphone in between sections (which works fine) for "fast forward" and "repeat". The code can recognize "continue","stand by", "repeat" and "fast forward" (on the microcontroller).
I would like a section of the program with a variable "DeltaIndex" which will change values and then read the corresponding section of the text, test for "repeat" and "fast forward" again, and do it again. Here is what the code looks like:
Code:
DeltaIndex=0; // Start DeltaIndex=0 at the beginning of every text reading
if(the user said read a certain text)
{
while(DeltaIndex<=8) //Don't want to go past the number of sections
{
go to the function that reads the current section based on the index, test the mic for a word ("continue","stand by", "repeat" and "fast forward") then do that and come back here and re-evaluate the while statement then go to the function that reads the current section based on the index.
}
}
I am currently trying to implement the suggestions above. I emphatically appreciate your help.