@@ -498,7 +498,7 @@ class CarSens {
498
498
// 240 ohm sender voltage would be 4.5*240/(150+240) = 2.8V
499
499
// 33 ohm sender voltage would be 4.5*33/(150+33) = 0.8V
500
500
// 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 );
502
502
}
503
503
504
504
int getTnkBnz () {
@@ -885,14 +885,17 @@ void CarSens::sensTnk() {
885
885
Serial.println (lpgTankLevel);
886
886
887
887
if (lpgTankLevel > 0 ) {
888
- containerLpgTank += lpgTankLevel;
888
+ containerLpgTank = containerLpgTank + lpgTankLevel;
889
889
CUR_LTK = int (containerLpgTank / indexLpgTank);
890
+
891
+ CUR_LTK = lpgTankLevel;
892
+
890
893
}
891
894
}
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
+ // }
896
899
}
897
900
898
901
/* *
@@ -902,20 +905,22 @@ void CarSens::sensEnt() {
902
905
// if (_amp->isLow()) {
903
906
904
907
int val = analogRead (pinTemp);
905
- if (val > 500 ) {
908
+ if (val > 800 ) {
906
909
engineTempHigh++;
907
910
}
908
911
engineTempIndex++;
909
912
910
913
911
914
if (_amp->isSens ()) {
912
- CUR_ENT = int (engineTempIndex - engineTempHigh) * 8 ;
915
+ CUR_ENT = int (engineTempIndex - engineTempHigh);
913
916
914
917
#ifdef DEBUG_ENG_TEMP
915
918
916
919
Serial.print (" Engine temperature: " );
917
920
Serial.print (val);
918
- Serial.print (" / " );
921
+ Serial.print (" / index: " );
922
+ Serial.print (engineTempIndex);
923
+ Serial.print (" / high: " );
919
924
Serial.print (engineTempHigh);
920
925
Serial.print (" / result:" );
921
926
Serial.println (CUR_ENT);
0 commit comments