Make ir sensor work.

I bought an it obstacle detector sensor which has 3 pins, V, out, gnd. How can I program it? I only know that v pin goes in 5V, gnd in ground and out pin in a pmw pin. Please help.

First you need to tell us what model of sensor it is, preferably with a link to its datasheet.

"". Here is the link.

Ok well that doesn't say much.

But it seems you just need to digitalRead the pin to which you connect the output. It will change as the object gets close.

I see it says you can configure it to be high when the object's near or low when it's near, whichever is more convenient for you. (AH or AL = active high or active low)

I'd be inclined to go for active low, set the Arduino pin's pullup resistor and then look for the pin to go low with digitalRead. This tutorial should get you going.....

(No need to worry about PWM as in your first post: that's for analog outputs.)

Thanks mate!