TCRT5000

I have a qeustion.

i want to connect a TCRT5000 to the Arduino. I know how to connect it but i don't know the exact code that i need to use to let the sensor work. So if the sensor get's no signal back a led must be switched on.

Could someone tell me the right code?

You should be able to use digitalRead to determine if the detector sees anything.

don't know the exact code that i need to use to let the sensor work

v = digitalRead(pin);

Where pin is the pin number you have connected the sensor to and v is the sensor value.

I know how to connect it

Do you? The question you posted implies you don't. How have you connected it up and what value of pull up resistor have you used? What value of current limiting resistor have you used in the IR emitter?

Do you? The question you posted implies you don't.

actually, yes I do. I first search the forum before i post something. So i already saw how to do it :wink:

Thanks for your post! i already did it the way you told me. It didn't worked i geuss i need to check if the sensor still works...

Go on then what value of resistors did you use? There is not a lot to go wrong if you wire it up right.