Skip to content

Commit e11aa5b

Browse files
committed
After tests ... commit
1 parent 69ff83a commit e11aa5b

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

Diff for: MID/lib/CarSens.h

+14-9
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ class CarSens {
498498
// 240 ohm sender voltage would be 4.5*240/(150+240) = 2.8V
499499
// 33 ohm sender voltage would be 4.5*33/(150+33) = 0.8V
500500
// So in my case 20k fuel gauge
501-
return (int) map(CUR_LTK, 35, 50, 0, 100);
501+
return (int) map(CUR_LTK, 10, 55, 0, 100);
502502
}
503503

504504
int getTnkBnz() {
@@ -885,14 +885,17 @@ void CarSens::sensTnk() {
885885
Serial.println(lpgTankLevel);
886886

887887
if (lpgTankLevel > 0) {
888-
containerLpgTank += lpgTankLevel;
888+
containerLpgTank = containerLpgTank + lpgTankLevel;
889889
CUR_LTK = int(containerLpgTank / indexLpgTank);
890+
891+
CUR_LTK = lpgTankLevel;
892+
890893
}
891894
}
892-
if (_amp->isMinute()) {
893-
containerLpgTank = 3;
894-
indexLpgTank = CUR_LTK * 3;
895-
}
895+
// if (_amp->isMinute()) {
896+
containerLpgTank = 3;
897+
indexLpgTank = CUR_LTK * 3;
898+
// }
896899
}
897900

898901
/**
@@ -902,20 +905,22 @@ void CarSens::sensEnt() {
902905
// if (_amp->isLow()) {
903906

904907
int val = analogRead(pinTemp);
905-
if (val > 500) {
908+
if (val > 800) {
906909
engineTempHigh++;
907910
}
908911
engineTempIndex++;
909912

910913

911914
if (_amp->isSens()) {
912-
CUR_ENT = int(engineTempIndex - engineTempHigh) * 8;
915+
CUR_ENT = int(engineTempIndex - engineTempHigh);
913916

914917
#ifdef DEBUG_ENG_TEMP
915918

916919
Serial.print("Engine temperature: ");
917920
Serial.print(val);
918-
Serial.print(" / ");
921+
Serial.print(" / index: ");
922+
Serial.print(engineTempIndex);
923+
Serial.print(" / high: ");
919924
Serial.print(engineTempHigh);
920925
Serial.print(" / result:");
921926
Serial.println(CUR_ENT);

Diff for: MID/lib/Lcd16x2.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ void displayFuelTanks() {
323323
lcd.print("%");
324324
lcd.print(" Lpg:");
325325
lcd.print(dspLpg);
326-
lcd.print("%");
326+
lcd.print("% ");
327327
}
328328
}
329329

0 commit comments

Comments
 (0)