IR counter

Do you want to implement kind of a light barrier? Or do you want to know in what distance the "things" in front of your sensor are? Please describe what you want to achieve.