I'm not sure what you want. The IR detectors simply output a "1" when they see IR light, and a "0" when they don't.
If you are making a beam-break system, then when the output goes low an object has broken the beam.
If you are making a reflective system, then when the output goes high an object is infront of the receiver.
If you want code to generate the 38KHz, then use:
IR_LED PIN RA.0 OUTPUT ' Use whatever pin you want
INTERRUPT 76000 ' 2x frequency wanted
IR_LED = ~IR_LED
RETURNINT
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Never argue with an idiot.· They'll drag you down to their level then beat you with experience.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - www.hittconsulting.com ·
Comments
If you are making a beam-break system, then when the output goes low an object has broken the beam.
If you are making a reflective system, then when the output goes high an object is infront of the receiver.
If you want code to generate the 38KHz, then use:
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never argue with an idiot.· They'll drag you down to their level then beat you with experience.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.hittconsulting.com
·