Actually fix the TPS from the last commit

This commit is contained in:
Josh Stewart 2015-06-09 23:43:51 +10:00
parent ade1b4d4b1
commit c8a7684d5a
1 changed files with 2 additions and 3 deletions

View File

@ -340,9 +340,8 @@ void loop()
{ {
currentStatus.TPSlast = currentStatus.TPS; currentStatus.TPSlast = currentStatus.TPS;
currentStatus.TPSlast_time = currentStatus.TPS_time; currentStatus.TPSlast_time = currentStatus.TPS_time;
int tpsTemp = analogRead(pinTPS); currentStatus.tpsADC = fastMap1023toX(analogRead(pinTPS), 0, 1023, 0, 255); //Get the current raw TPS ADC value and map it into a byte
currentStatus.tpsADC = fastMap1023toX(tpsTemp, 0, 1023, 0, 255); //Get the current raw TPS ADC value and map it into a byte currentStatus.TPS = map(currentStatus.tpsADC, configPage1.tpsMin, configPage1.tpsMax, 0, 100); //Take the raw TPS ADC value and convert it into a TPS% based on the calibrated values
currentStatus.TPS = map(tpsTemp, configPage1.tpsMin, configPage1.tpsMax, 0, 100); //Take the raw TPS ADC value and convert it into a TPS% based on the calibrated values
currentStatus.TPS_time = currentLoopTime; currentStatus.TPS_time = currentLoopTime;
} }