Arduino lookup table

Hi all ,
I am trying to design a medical grade thermometer, for which i want to make a look up table.
I have seen the arduino official forum and implemented a same example but i am unable to understand the mapping of data by look up table. For example If am creating a small table as below:
Temp Voltage
50° F (10° C) 3.51 V DC
68° F (20° C) 3.07 V DC
86° F (30° C) 2.60 V DC
104° F (40° C) 2.13 V DC
122° F (50° C) 1.7 V DC
140° F (60° C) 1.33 V DC
158° F (70° C) 1.02 V DC
176° F (80° C) 0.78 V DC
194° F (90° C) 0.60 V DC
212° F (100° C) 0.46 V DC
How should i go about it.
I am not able to reproduce the table as it is.
Thanks,
Shivam

Hello Shivam.
Use this example https://learn.adafruit.com/tmp36-temperature-sensor/using-a-temp-sensor

Thanks, but i want to use a lookup table because my sensor will not support the formula mentioned above to convert ADC reading in volts to temperature. It will be helpfull for me to use a look up table as i want the precision to be up to 2 decimal places.

Someone please help me in getting lookup table in arduino.

Here is how you should do it,

typedef struct
{
    float f;
    float c;
    float Voltage;
    
}TemperatureType;

TemperatureType Temp[10] = {
{50,   10, 3.51},
{68,   20, 3.07},
{86,   30, 2.60},
{104, 40, 2.13},
{122, 50, 1.7},
{140, 60, 1.33},
{158, 70, 1.02},
{176, 80, 0.78},
{194, 90, 0.60},
{212, 100,0.46}
};

To get the corresponding fahrenheit from voltage you should compare all the indexes from 0 to 10 in a loop and print out the matching value.

V = ReadADC();
for(i=0;i<10;i++)
{
    if(V == Temp[i].Voltage ) {  Print(Temp[i].c); } // To print in celcius   or Temp[i].f to print the value in farenhiet.
}

This is absolute comparison, you should use ranges like Vmin and Vmax and compare the voltage if its within that range and print it out.

The code above is just a pseudo code to give an idea, You need to adopt it to the platform you are using.

Hi,
Please see the link below which i am trying to implement.

https://playground.arduino.cc/ComponentLib/Thermistor

I am not able to get the corresponding values.
Thanks,
Shivam