/***************************************************************************** Function: INT Interpolate (INT xvalue, tValTable * pTable) Parameters: INT xvalue: value to search for in table tTable * pTable: pointer to value table struct Return value: INT: interpolated value (or lowest or highest point if outside range) Description: Interpolates values from a given table. If the searched value is outside the table range the corresponding (lowest or highest) y-point value is returned. *****************************************************************************/ const tValTableEntry R2Temp_Ni1000[] = { { 695, -600}, { 1000, 000}, { 1291, 500}, { 1443, 750}, { 1618, 1000}, { 2231, 1800}, {INT_MAX, INT_MAX} }; void main (void) { while(1) { DP9=0x0010; Interpolate (?,?); P9=0x0010; } } INT Interpolate (INT xvalue, tValTable * pTable) {.....}