Without re-reading all 4 pages of this thread, this is what I recall...
You wanted to break out of a loop when an IR code was received. The loop was fading something.
This is eminently achievable, I think. However your original code had two problems:
- Your function getIR, which you call repeatedly, does nothing useful, because it does not alter any global variables.
- Even if it did set global variables, you are not testing any variables in the loop which does the fade.
I can't see that you have attempted to address those issues.