1. Code:
```unsigned int read_adc(unsigned char adc_input){
);//start conversion
while(!(ADCSRA & 0x10)); //Wait for conversion to complete
}```
Salem this is something i found at the website you gave me. This is the conversion part right?

2. Looks promising.

3. Salem > so sorry to bother you always, but I've been hearing alot of the Vref thingy. But i don't really understand what is it about.

They gave me an example.

Supposing, at a temperature of 30 deg C, it gives an output of 3V (this is just an example, check the datasheet of LM35 for exact figures). You have set a Vref+ at 5V and Vref- at 0V. Then if you do the AD conversion correctly, your ADC will read:

3 volt
-------- x 0x3FF ~= 0x265
5 volt

I'm somewhere there, but not fully.

4. It's just simple linear interpolation

You then need another set of interpolation limits (assuming the relationship is linear), which turns say 3V into 30&#176;C

5. woah, hmm it's getting weird.

What i heard from my friend is Vref is generated using a potentiometer. Using that you can "substitude" it for the sensor.

How do you determine that 3V is 30 celsius?. Or do i assume a imaginary figure and work from there on?.

6. > How do you determine that 3V is 30 celsius?.
I thought you knew that already, with "check the datasheet of LM35 for exact figures".

We really need a circuit diagram of some sort to visualise how all these Vref's relate to one another.

A potentiometer is good, since you can just turn it to generate varying input at the ADC, and from that generate a changing display.

For the moment, just try displaying the hex value of the ADC result on your LCD, then worry about all the conversions later.

7. i think i got alot of reading to do.

thanks Salem, i'll do whatever i can before i comeback here agaiin.

the code i pasted youi before, some other forummers said it was for another PIC18 controller.

thanks

8. I've been reading alot this few days, but suddenly something struck me.

>For the moment, just try displaying the hex value of the ADC result on your LCD, then worry about all the conversions later.
If I plugged the sensor into the ADC port, it will display the hex values on the LCD? I mean after programming.

I don't know whether the sensor is working or not lol. Cause it's like no where to show even hex values.