Reading values from LM35 - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Reading values from LM35

Hi everyone,
i am using LM35 with pic16f877a.i have generate a code for reading values and display it on the pc through serial port.i am using 10-bit ADC.
the values displayed on pc are right but i am not sure that they are right or my code is right.
my code is as

void main()
{
float value,value1;
setup_adc_ports(ALL_ANALOG);
setup_adc(ADC_CLOCK_INTERNAL);

while(1)
{
set_adc_channel(2);
delay_ms(500);
value=read_adc();
value1=value+0.5;
printf("%f
",value1);
}
}

tell me that i am doing right or wrong.

Sign In or Register to comment.