The tricky part as I see it, under Richard's directions, is the processing of ir in the foreground. But states will help, as long as your routines are fast enough.
Better start with one task at the time and if it works ok, add another. All together might complex things and prevent debugging.
Ioannis
Bookmarks