Hi guys, I'm having a hard time figuring out how to use a TIL 32 (IR emissor diode) and a TIL 78 (IR phototransistor) to just toggle on and off a port in PIC.
The chip I'm working on is a 16f877, and I building some sort of telemetric hardware for my R/C 1:10 car (nice !!)
I have all sorts of things working on this chip already, like USART (wireless communication) , A/D (for the engine temp) and a LCD attached to it.
I can't figure out what's needed for this TIL 78 to work as a switch when pointing to the IR emissor, TIL 32, I have the feeling I'm just missing a couple of pull down or up resistors.
The actual usage of this will be like a RPM counter, so all it needs is to trigger the port on and off. (it will be the exact system used on those old ball mouses)
Quick questions :
1. Can I setup the port as digital input or should I use analog insted ?
2. Both pieces are made from translucid plastic, both have two legs only, like any LED, and one has bigger legs than the other, so I'm guessing the TIL 78 is the one with the longer legs
Thank you all for your help.