UTI e pt100

ciao a tutti
sto cercando di leggere la temperatura di tre sonde pt100 collegate ad un Smartec UTI, ho trovato questo code ma mi da un valore , come faccio a far risultare il valore reale di °C .

code:
#include <stdio.h>
#include “pins_arduino.h”

#define UTI_PIN 5
#define UTI_RESISTANCE_REF 1000

void setup()
{
Serial.begin(9600);
pinMode(UTI_PIN, INPUT);
}

void loop()
{
double res1,res2,res3;

if(ReadUTI(UTI_PIN,&res1,&res2,&res3,UTI_RESISTANCE_REF)) {
Serial.print(“Resistance 1: “);
Serial.print(res1);
Serial.print(”\t”);
Serial.print(“Resistance 2: “);
Serial.print(res2);
Serial.print(”\t”);
Serial.print(“Resistance 3: “);
Serial.print(res3);
Serial.print(”\t”);
}
else {
Serial.print(“Not Found”);
}
Serial.print("\n");
delay(2000);
}

int ReadUTI(uint8_t pin, double * res1,double * res2,double * res3,int refRes)
{
int state = HIGH;
int i,startindex=-1;
uint8_t bit = digitalPinToBitMask(pin);
uint8_t port = digitalPinToPort(pin);
uint8_t stateMask = (state ? bit : 0);
unsigned long width[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
double nOff=0,nAB=0,nCD=0,nBC=0,nDF=0;

while ( (*portInputRegister(port) & bit) != stateMask)
;

for(i=0;i<12;i++) {
while ( (portInputRegister(port) & bit) == stateMask)
width
++;*
_ while ( (portInputRegister(port) & bit) != stateMask)_
_ width
++;_
_
}_
_
for(i=1;i<12;i++) {_
_
if(i<7) {_
if(width<width[i+2]&&width<width[i+3]&&width_<width[i+4]&&width<width[i+5]&&width[i+1]<width[i+2]&&width[i+1]<width[i+3]&&width[i+1]<width[i+4]&&width[i+1]<width[i+5]) {
startindex=i;
i=12;
}
}
}
if(startindex!=-1) {
nOff=width[startindex]+width[startindex+1];
nAB=width[startindex+2];
nCD=width[startindex+3];
nBC=width[startindex+4];
nDF=width[startindex+5];
res1=((nBC-nOff)/(nAB-nOff))refRes;
res2=((nCD-nOff)/(nAB-nOff))refRes;
res3=((nDF-nOff)/(nAB-nOff))refRes;
return 1;

}

else {

return 0;
}
}*_