IR sensor program

Hi!

Anyone can suggest what command can i use if my reading from a sensor (assuming IR distance sensor includes cable (20cm-150cm) [GP2Y0A02YK] : ID 1031 : $15.95 : Adafruit Industries, Unique & fun DIY electronics and kits) produces a certain voltage, then it would convert it into a 1 count?

I am about to create a counter using the said sensor.
Appreciate any ideas :slight_smile: