gauge: calibrate ECT 3-tier colors for Ford Ka Endura (Green <98, Yellow 98-105, Red >=106)

This commit is contained in:
Sebastián Nieto 2026-09-09 22:36:01 -03:00
parent 6db6187011
commit 8887ab4265
3 changed files with 10 additions and 4 deletions

View file

@ -63,8 +63,8 @@ class VehicleState:
self.speed = 15.0 + 160.0 * ((self.rpm - 800.0) / 5200.0) self.speed = 15.0 + 160.0 * ((self.rpm - 800.0) / 5200.0)
if self.speed < 0: if self.speed < 0:
self.speed = 0.0 self.speed = 0.0
# Coolant temp rises slightly with engine load (88°C -> 102°C, showing warn RED past 100°C) # Coolant temp rises with engine load (88°C -> 108°C: Green <98, Yellow 98-105, Red >=106)
self.coolant_temp = 88.0 + 14.0 * ((self.rpm - 800.0) / 5200.0) self.coolant_temp = 88.0 + 20.0 * ((self.rpm - 800.0) / 5200.0)
self.oil_temp = 90.0 + 12.0 * ((self.rpm - 800.0) / 5200.0) self.oil_temp = 90.0 + 12.0 * ((self.rpm - 800.0) / 5200.0)
self.trans_temp = 82.0 + 1.0 * math.cos(t * 0.09) self.trans_temp = 82.0 + 1.0 * math.cos(t * 0.09)
self.pcm_volt = 14.2 + 0.15 * math.sin(t * 0.5) self.pcm_volt = 14.2 + 0.15 * math.sin(t * 0.5)

View file

@ -695,9 +695,15 @@ inline void drawQuadrantDividers() {
} }
// Determine display color for meter: // Determine display color for meter:
// ECT (PID 0): VERDE (< 98), AMARILLO (98-105), ROJO (>= 106)
// RPM (PID 1): VERDE (< 3500), AMARILLO (3500-5000), ROJO (5000-6000) // RPM (PID 1): VERDE (< 3500), AMARILLO (3500-5000), ROJO (5000-6000)
// Otros instrumentos: VERDE / ROJO (según umbral de advertencia) // Otros instrumentos: VERDE / ROJO (según umbral de advertencia)
inline uint16_t getMeterColor(uint8_t pidIdx, float data, int warn) { inline uint16_t getMeterColor(uint8_t pidIdx, float data, int warn) {
if (pidIdx == 0) { // 0 = Temperatura ECT (PID 0105)
if (data >= 106.0f) return TFT_RED;
if (data >= 98.0f) return TFT_YELLOW;
return TFT_GREEN;
}
if (pidIdx == 1) { // 1 = RPM (PID 010C) if (pidIdx == 1) { // 1 = RPM (PID 010C)
if (data >= 5000.0f) return TFT_RED; if (data >= 5000.0f) return TFT_RED;
if (data >= 3500.0f) return TFT_YELLOW; if (data >= 3500.0f) return TFT_YELLOW;

View file

@ -83,14 +83,14 @@ warn = default warning value
*/ */
const String pidConfig[4][9] = { const String pidConfig[4][9] = {
//[pid][data] //[pid][data]
{ "Temperatura", "`C", "0105", "1", "0", "120", "2", "0", "100" }, //0 = Temperatura (0105) { "Temperatura", "`C", "0105", "1", "0", "120", "2", "0", "106" }, //0 = Temperatura (0105)
{ "RPM", "rpm", "010C", "3", "0", "6000", "0", "0", "5000" }, //1 = RPM (010C) { "RPM", "rpm", "010C", "3", "0", "6000", "0", "0", "5000" }, //1 = RPM (010C)
{ "Voltaje", "V", "0142", "4", "0", "16", "1", "1", "15" }, //2 = Voltaje (0142) { "Voltaje", "V", "0142", "4", "0", "16", "1", "1", "15" }, //2 = Voltaje (0142)
{ "Velocidad", "km/h", "010D", "7", "0", "180", "0", "0", "130" } //3 = Velocidad (010D) { "Velocidad", "km/h", "010D", "7", "0", "180", "0", "0", "130" } //3 = Velocidad (010D)
}; };
//hold warning value //hold warning value
String warningValue[4] = { "100", "5000", "15", "130" }; String warningValue[4] = { "106", "5000", "15", "130" };
/* /*
0 - Refrigerante 0 - Refrigerante