Am programming in c,using mp lab.
I have set RD5 as the output of the pic.i need the output to be 0 above a cetain undesired high voltage and also below a certain low voltage.
Where does the voltage to be measured come from?
What voltage range is involved?
How is it connected to the PIC?
Basically you will have to adpat the voltage to be measured to the input range of the PIC's ADC by either amplifying or attenuating it. You the use the PIC's ADC to measure the voltage and set the output level of RD5 accordin to the measured voltage level.