Skip to content
C

add gt7 support

YU CHIH CHANGfc714d02b554
diff --git a/README.md b/README.md
index 1ee9b4c..bc9a9a7 100644
--- a/README.md
+++ b/README.md
@@ -106,3 +106,40 @@ Some Arduino APIs for the ESP32 are different, so not everything will work out o
### How to enable ESP32
- Open `platformio.ini`, comment out the ESP8266 env and Uncomment the ESP32 env. Also specify your board in the env, by default is set to something like `esp32doit-devkit-v1` because I owned this board, but there are tons of boards for the ESP32, as you can see [here](https://docs.platformio.org/en/latest/boards/index.html#espressif-32). Click on one and it will show you what's its id.
- Make sure to use the correct pin numbers for the ESP32 as opposed to aliases such as D1, D2, D3.. etc
+
+# Custom protocol for GT7
+```
+format([DataCorePlugin.GameData.NewData.SpeedKmh],'0') + ';' +
+isnull([DataCorePlugin.GameData.NewData.Gear],'N') + ';' +
+format([CarSettings_CurrentDisplayedRPMPercent],'0') + ';' +
+format([CarSettings_RPMRedLineSetting],'0') + ';' +
+
+left([CurrentLapTime],3,8) + ';' +
+left([LastLapTime],3,8) + ';' +
+left([BestLapTime],3,8) + ';' +
+
+format([PersistantTrackerPlugin.SessionBestLiveDeltaSeconds],'0.000') + ';' +
+format([PersistantTrackerPlugin.SessionBestLiveDeltaProgressSeconds],'0.00') + ';' +
+
+format([DataCorePlugin.Computed.Fuel_RemainingLaps], '0.0') + ';' +
+format([DataCorePlugin.GameRawData.PreRaceStartPositionOrQualiPos], '0') + ';' +
+
+format([DataCorePlugin.GameData.CurrentLap], '0') + '/' +
+format([DataCorePlugin.GameData.TotalLaps], '0') + ';' +
+
+[DataCorePlugin.GameData.ABSActive] + ';' +
+
+format([DataCorePlugin.GameData.Throttle], '0') + ';' +
+'0' + ';' +
+
+format([DataCorePlugin.GameData.Brake], '0') + ';' +
+'0' + ';' +
+
+'True' + ';' +
+'0' + ';' +
+
+format([FuelPercent], '0') + ';' +
+'0' + ';' +
+
+[LapInvalidated] + ';'
+```
\ No newline at end of file
diff --git a/src/SHCustomProtocol.h b/src/SHCustomProtocol.h
index ac05c53..f885282 100644
--- a/src/SHCustomProtocol.h
+++ b/src/SHCustomProtocol.h
@@ -200,15 +200,15 @@ public:
if (isTCCutNull == "False")
drawCell(COL[0], ROW[4], tcTcCut, "tcTcCut", "TC TC2", "center", TFT_YELLOW, 4, forceUpdate);
else
- drawCell(COL[0], ROW[4], tcLevel, "tcLevel", "TC", "center", TFT_YELLOW, 4, forceUpdate);
- drawCell(COL[1], ROW[4], absLevel, "absLevel", "ABS", "center", TFT_BLUE, 4, forceUpdate);
- drawCell(COL[2], ROW[4], brakeBias, "brakeBias", "BB", "center", TFT_MAGENTA, 4, forceUpdate);
+ drawCell(COL[0], ROW[4], tcLevel, "tcLevel", "THR", "center", TFT_YELLOW, 4, forceUpdate);
+ drawCell(COL[1], ROW[4], absLevel, "absLevel", "BRK", "center", TFT_BLUE, 4, forceUpdate);
+ drawCell(COL[2], ROW[4], brakeBias, "brakeBias", "Fuel%", "center", TFT_MAGENTA, 4, forceUpdate);
// (tyre pressure)
- drawCell(COL[3], ROW[3], tyrePressureFrontLeft, "tyrePressureFrontLeft", "FL", "center", TFT_CYAN, 4, forceUpdate);
- drawCell(COL[4], ROW[3], tyrePressureFrontRight, "tyrePressureFrontRight", "FR", "center", TFT_CYAN, 4, forceUpdate);
- drawCell(COL[3], ROW[4], tyrePressureRearLeft, "tyrePressureRearLeft", "RL", "center", TFT_CYAN, 4, forceUpdate);
- drawCell(COL[4], ROW[4], tyrePressureRearRight, "tyrePressureRearRight", "RR", "center", TFT_CYAN, 4, forceUpdate);
+ drawCell(COL[3], ROW[3], tyrePressureFrontLeft, "tyrePressureFrontLeft", "RL", "center", TFT_CYAN, 4, forceUpdate);
+ drawCell(COL[4], ROW[3], tyrePressureFrontRight, "tyrePressureFrontRight", "POS", "center", TFT_CYAN, 4, forceUpdate);
+ drawCell(COL[3], ROW[4], tyrePressureRearLeft, "tyrePressureRearLeft", "LAP", "center", TFT_CYAN, 4, forceUpdate);
+ drawCell(COL[4], ROW[4], tyrePressureRearRight, "tyrePressureRearRight", "ABS", "center", TFT_CYAN, 4, forceUpdate);
}
void drawColoredButton(int x, int y, int width, int height, String label, uint16_t color) //disegna i pulsanti della pagina 2