I am looking to use an LM61 to measure temperature.

The problem I am having is the conversion from the LM61 O/P and the displayed value.

In the data sheet, attached, it gives:-

7.3.1 LM61 Transfer Function
The LM61 follows a simple linear transfer function to achieve the accuracy as listed in Electrical Characteristics.
Use Equation 1 to calculate the value of VO.
VO = 10 mV/°C × T°C + 600 mV
where
• T is the temperature in °C
• VO is the LM61 output voltage

and various other permutations, always gives me silly answers.
For example, if the A/D reading is 1023, the answer would be 439.5C and if A/D is 1 then the answers would be -59.5C, neither of which is anywhere near the data sheet values

T Operating temperature
LM61C –30 to 100°C
LM61B –25 to 85°C

The above calculations were done on a calculator, as I can’t incorporate into the sketch till I work out the formula.

before you do your calculation, it will amend the reading on the analog pin from 0-1024 to it's corresponding value between 0 and 5 V. Then use that in your calculation.

That (I think) will give you the reading on your pin in V. Then rearrange the formulae on the datasheet for T

This is not the way, as the result of map is an int.

You could map the input to a value 100 times larger than you need and divide the result by 100 to give a float with 2 decimal places. Leave the output as an int until all calculations have been done and maybe only divide by 100 for the purposes of displaying the result. Doing this will avoid calculations involving floats which are time consuming.

No worry, John. UKHeliBob has shown how to use map to include decimals.

Another problem, uncovered after rereading the data sheet, is that the LM61 O/P is independent of the supply voltage and is typically 300mV - 1600mV, giving -30C - 100C, @10mV/degC. Hence the ridulous "temperature" values I was getting, using the calculator.

I guess I am going to have to use the internal 2v56 reference, and then calculate only the relevent ADC values (once I work out how to do that).

Fof

EDIT: Corrected the internal ref from 2v4 to 2v56.