Experimental temperature fix

This commit is contained in:
Josh Stewart 2015-01-12 23:23:43 +11:00
parent 45e4cb6466
commit 2f94559101
2 changed files with 4 additions and 3 deletions

View File

@ -357,6 +357,7 @@ void receiveCalibration(byte tableID)
tempBuffer[1] = Serial.read(); tempBuffer[1] = Serial.read();
tempValue = div(int(word(tempBuffer[0], tempBuffer[1])), DIVISION_FACTOR).quot; //Read 2 bytes, convert to word (an unsigned int), convert to signed int. These values come through * 10 from Tuner Studio tempValue = div(int(word(tempBuffer[0], tempBuffer[1])), DIVISION_FACTOR).quot; //Read 2 bytes, convert to word (an unsigned int), convert to signed int. These values come through * 10 from Tuner Studio
tempValue = ((tempValue - 32) * 5) / 9; //Convert from F to C
} }
tempValue = tempValue + OFFSET; tempValue = tempValue + OFFSET;

View File

@ -263,9 +263,9 @@ void loop()
//The IAT and CLT readings can be done less frequently. This still runs about 10 times per second //The IAT and CLT readings can be done less frequently. This still runs about 10 times per second
if ((mainLoopCount & 127) == 1) if ((mainLoopCount & 127) == 1)
{ {
currentStatus.cltADC = map(analogRead(pinCLT), 0, 1023, 0, 512); //Get the current raw CLT value currentStatus.cltADC = map(analogRead(pinCLT), 0, 1023, 0, 511); //Get the current raw CLT value
currentStatus.iatADC = map(analogRead(pinIAT), 0, 1023, 0, 512); //Get the current raw IAT value currentStatus.iatADC = map(analogRead(pinIAT), 0, 1023, 0, 511); //Get the current raw IAT value
currentStatus.O2ADC = map(analogRead(pinO2), 0, 1023, 0, 512); //Get the current O2 value. Calibration is from AFR values 7.35 to 22.4. This is the correct calibration for an Innovate Wideband 0v - 5V unit. Proper calibration is still a WIP currentStatus.O2ADC = map(analogRead(pinO2), 0, 1023, 0, 511); //Get the current O2 value. Calibration is from AFR values 7.35 to 22.4. This is the correct calibration for an Innovate Wideband 0v - 5V unit. Proper calibration is still a WIP
currentStatus.battery10 = map(analogRead(pinBat), 0, 1023, 0, 245); //Get the current raw Battery value. Permissible values are from 0v to 24.5v (245) currentStatus.battery10 = map(analogRead(pinBat), 0, 1023, 0, 245); //Get the current raw Battery value. Permissible values are from 0v to 24.5v (245)
//currentStatus.batADC = map(analogRead(pinBat), 0, 1023, 0, 255); //Get the current raw Battery value //currentStatus.batADC = map(analogRead(pinBat), 0, 1023, 0, 255); //Get the current raw Battery value