You are here: Home
well i assume that there’s no problem with your LCD CODE…so you are getting output on LCD but you have a problem in ADC CODE and Interfacing
Interfacing is quite simple : Simply Connect LM35 to your ADC PIN
CODE ERROR:
I have found in your code that you are returning ADCH in adc_conv() function but my friend ADCH carries only upper bits of the resulting step as ATMEGA16/32 supports 10bit resolution ADC
ADCH :- 9:8
ADCL :- 7:0
thus whole ADCL and ADCH combine gives the result of ADC
and for that you only need to change ADC instead of ADCH
where ADC register is 10 bit register and it combines ADCL and ADCH
and don’t forget to change the return type of your function to unsigned short int adc_conv() for 10bit return
Try this i am sure this will surely clears your problem….
and still you find problem try to refer DATASHEET.. it will explain you very well…