toto_na16
Member level 1
I have some problem using comparator module.
I want to activate a fan on 25 degree so i connected lm35 output to a 5 mega resistor and connected to RA3
and a reference of 0.25 v to RA0
and the c code
using portd as an indicator to the change in the c1out
anyone can help me in this project??
I will be very thankful :|[/code]
I want to activate a fan on 25 degree so i connected lm35 output to a 5 mega resistor and connected to RA3
and a reference of 0.25 v to RA0
and the c code
Code:
void com_inti(){
CMCON.C1INV = 0;
CMCON.F2 = 0;
CMCON.F1 = 0;
CMCON.F0 =1;
}
void main(){
TRISA.F0 = 1;
TRISA.F3 = 1;
TRISA.F4 = 0;
TRISD = 0x00;
com_inti();
while(1){
if(CMCON.C1OUT)
PORTD = 0b01010101;
else
PORTD = 0b00001111;
}
}
using portd as an indicator to the change in the c1out
anyone can help me in this project??
I will be very thankful :|[/code]