I need help with writing comparator program

Status
Not open for further replies.

wakaka

Full Member level 4
Joined
Dec 7, 2005
Messages
237
Helped
10
Reputation
20
Reaction score
6
Trophy points
1,298
Activity points
2,931
877A comparator

Im a noob in programming, this is my program:

#include <16F877a.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay (clock=20000000)

void main()

{
byte value;

setup_port_a(ALL_ANALOG);
setup_adc(adc_clock_internal);
set_adc_channel( 5 );
setup_vref(VREF_HIGH|15);


setup_comparator(A0_A3_A1_A2);

// here i dunno how to proceed. If A3's voltage is greater than A2's, output_high(Pin_B7). or is there any other ways to do it??? need help, thanks......
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…