Re: I have a complicated autonomos problem I need help with.
First off, your else statement will be contradicting your first if statement, so you might want to look at my fix. Im just assuming that < 7 means to move forward here. Here's some code with timers that I would use, I'm not sure if it works since I've never actually used the timer function but it should be fine.
So the int valTime is constantly being updated to the built in timer T1 while the IRSeeker is < 7. The ClearTimer function will set T1 to 0, I'm just assuming you start off in the process you want to time. If not then just clear it right before you do this. Then you can just use valTime in a wait1msec function. Hopefully that helps.
p.s. - im not sure what your "hi;" does, but I will just assume its part of hitechnic-irseeker-v2.h which I don't use, I just use SensorValue for the IRSeeker.