i'm have a problem with adc or comparator. who can give me the source code. For example When the potentiometer is set to a voltage under 2.5 V, the comparator's output will be low and the LED at RD0 is ON. But when the potensiometer is turned up past hafway or more than 2.5 V, the comparator's output will go high, LED at RD1 is On. Thanks...
just use one comparator and two leds. Keep 2.5V as reference voltage and keep potentiometer at other end voltage. To the output of comparator connect two LED's parallel one end to comparator output and other end to gnd(second led to VCC).