diff options
author | Stanley Huang <stanleyhuangyc@gmail.com> | 2014-01-04 12:00:27 +1100 |
---|---|---|
committer | Stanley Huang <stanleyhuangyc@gmail.com> | 2014-01-04 12:00:27 +1100 |
commit | 9f525a76fa72de7078868cd4b818cdd83043a3ec (patch) | |
tree | c8447ca3e2da4b65c102ba174817cd863a9d319e /libraries/OBD/OBD.cpp | |
parent | ba3954b0817e10c2f514786005c302b7d707358f (diff) | |
download | 2021-arduino-obd-9f525a76fa72de7078868cd4b818cdd83043a3ec.tar.gz 2021-arduino-obd-9f525a76fa72de7078868cd4b818cdd83043a3ec.tar.bz2 2021-arduino-obd-9f525a76fa72de7078868cd4b818cdd83043a3ec.zip |
Update OBD PIDs definition
Diffstat (limited to 'libraries/OBD/OBD.cpp')
-rw-r--r-- | libraries/OBD/OBD.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/libraries/OBD/OBD.cpp b/libraries/OBD/OBD.cpp index 3360d07..c357da1 100644 --- a/libraries/OBD/OBD.cpp +++ b/libraries/OBD/OBD.cpp @@ -130,10 +130,13 @@ int COBD::normalizeData(byte pid, char* data) case PID_COOLANT_TEMP: case PID_INTAKE_TEMP: case PID_AMBIENT_TEMP: + case PID_ENGINE_OIL_TEMP: result = getTemperatureValue(data); break; - case PID_ABS_ENGINE_LOAD: - result = getLargeValue(data) * 100 / 255; + case PID_ABSOLUTE_ENGINE_LOAD: + case PID_ETHANOL_PERCENTAGE: + case PID_HYBRID_BATTERY_PERCENTAGE: + result = getLargeValue(data) * 100 / 255; // % break; case PID_MAF_FLOW: result = getLargeValue(data) / 100; @@ -146,10 +149,21 @@ int COBD::normalizeData(byte pid, char* data) case PID_TIMING_ADVANCE: result = (getSmallValue(data) - 128) >> 1; break; - case PID_DISTANCE: - case PID_RUNTIME: + case PID_DISTANCE: // km + case PID_RUNTIME: // second + case PID_FUEL_RAIL_PRESSURE: // kPa + case PID_ENGINE_REF_TORQUE: // Nm result = getLargeValue(data); break; + case PID_CONTROL_MODULE_VOLTAGE: // V + result = getLargeValue(data) / 1000; + break; + case PID_ENGINE_FUEL_RATE: // L/min + result = getLargeValue(data) * 3; + break; + case PID_ENGINE_TORQUE_PERCENTAGE: // % + result = (int)getSmallValue(data) - 125; + break; default: result = getSmallValue(data); } |