Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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.