Thanks for the help. I'll incorporate this into my program and see how it works out.
I also have a question about interrupts. If I want to detect objects moving in opposite directions, can I use an interrupt that goes to a subroutine that changes the on and off order of the sensors?
For example, if the objects are moving right to left, Sensor 1 turns the timer on and Sensor 2 turns the timer off. If the objects are moving left to right, then S2 turns it on and S1 turns it off. I thought about adding another sensor (S3) that will trigger the the order of the other two. This way I could use S1 to trigger the S2/S3 subroutine for objects moving in one direction and S3 to trigger the S2/S1 subroutine for objects moving in the opposite direction.
I hope this makes sense. Thanks again for the help.