Hi all, I’ve been using arduino for a while now but I’m still a novice when it comes to code, this is my first attempt to utilise a lookup table and i just can’t get my head around how to do it. Basically I’m trying to figure out how to use a lookup table for the values below (Vin being converted from adc) so that i can output a whole number to a display.

Temp; 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20

Vin (mV) 1034, 1028, 1023, 1017, 1012, 1007, 1001, 996, 990, 985, 980, 974, 969, 963, 958, 952, 947, 941, 936, 931, 925

I understand how to convert the adc value to a voltage, I just can’t figure out how to convert the voltage into the assosciated temp value in a form that will output The nearest whole number.

I have tried searching for examples but I either can’t find exactly what I’m looking for, or i just don’t understand what I’m looking at.