Skip to content

Commit 2b47fde

Browse files
authored
Update ELMduino.h
1 parent e21bd33 commit 2b47fde

1 file changed

Lines changed: 99 additions & 99 deletions

File tree

ELMduino.h

Lines changed: 99 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -12,126 +12,126 @@
1212
//-------------------------------------------------------------------------------------//
1313
// PIDs
1414
//-------------------------------------------------------------------------------------//
15-
const uint8_t SERVICE_01 = 1;
15+
const uint8_t SERVICE_01 = 1;
1616

1717

18-
const uint8_t SUPPORTED_PIDS_1_20 = 0; // 0x00 - bit encoded
18+
const uint8_t SUPPORTED_PIDS_1_20 = 0; // 0x00 - bit encoded
1919
const uint8_t MONITOR_STATUS_SINCE_DTC_CLEARED = 1; // 0x01 - bit encoded
20-
const uint8_t FREEZE_DTC = 2; // 0x02 -
21-
const uint8_t FUEL_SYSTEM_STATUS = 3; // 0x03 - bit encoded
22-
const uint8_t ENGINE_LOAD = 4; // 0x04 - %
23-
const uint8_t ENGINE_COOLANT_TEMP = 5; // 0x05 - °C
24-
const uint8_t SHORT_TERM_FUEL_TRIM_BANK_1 = 6; // 0x06 - %
25-
const uint8_t LONG_TERM_FUEL_TRIM_BANK_1 = 7; // 0x07 - %
26-
const uint8_t SHORT_TERM_FUEL_TRIM_BANK_2 = 8; // 0x08 - %
27-
const uint8_t LONG_TERM_FUEL_TRIM_BANK_2 = 9; // 0x09 - %
28-
const uint8_t FUEL_PRESSURE = 10; // 0x0A - kPa
29-
const uint8_t INTAKE_MANIFOLD_ABS_PRESSURE = 11; // 0x0B - kPa
30-
const uint8_t ENGINE_RPM = 12; // 0x0C - rpm
31-
const uint8_t VEHICLE_SPEED = 13; // 0x0D - km/h
32-
const uint8_t TIMING_ADVANCE = 14; // 0x0E - ° before TDC
33-
const uint8_t INTAKE_AIR_TEMP = 15; // 0x0F - °C
34-
const uint8_t MAF_FLOW_RATE = 16; // 0x10 - g/s
35-
const uint8_t THROTTLE_POSITION = 17; // 0x11 - %
20+
const uint8_t FREEZE_DTC = 2; // 0x02 -
21+
const uint8_t FUEL_SYSTEM_STATUS = 3; // 0x03 - bit encoded
22+
const uint8_t ENGINE_LOAD = 4; // 0x04 - %
23+
const uint8_t ENGINE_COOLANT_TEMP = 5; // 0x05 - °C
24+
const uint8_t SHORT_TERM_FUEL_TRIM_BANK_1 = 6; // 0x06 - %
25+
const uint8_t LONG_TERM_FUEL_TRIM_BANK_1 = 7; // 0x07 - %
26+
const uint8_t SHORT_TERM_FUEL_TRIM_BANK_2 = 8; // 0x08 - %
27+
const uint8_t LONG_TERM_FUEL_TRIM_BANK_2 = 9; // 0x09 - %
28+
const uint8_t FUEL_PRESSURE = 10; // 0x0A - kPa
29+
const uint8_t INTAKE_MANIFOLD_ABS_PRESSURE = 11; // 0x0B - kPa
30+
const uint8_t ENGINE_RPM = 12; // 0x0C - rpm
31+
const uint8_t VEHICLE_SPEED = 13; // 0x0D - km/h
32+
const uint8_t TIMING_ADVANCE = 14; // 0x0E - ° before TDC
33+
const uint8_t INTAKE_AIR_TEMP = 15; // 0x0F - °C
34+
const uint8_t MAF_FLOW_RATE = 16; // 0x10 - g/s
35+
const uint8_t THROTTLE_POSITION = 17; // 0x11 - %
3636
const uint8_t COMMANDED_SECONDARY_AIR_STATUS = 18; // 0x12 - bit encoded
3737
const uint8_t OXYGEN_SENSORS_PRESENT_2_BANKS = 19; // 0x13 - bit encoded
38-
const uint8_t OXYGEN_SENSOR_1_A = 20; // 0x14 - V %
39-
const uint8_t OXYGEN_SENSOR_2_A = 21; // 0x15 - V %
40-
const uint8_t OXYGEN_SENSOR_3_A = 22; // 0x16 - V %
41-
const uint8_t OXYGEN_SENSOR_4_A = 23; // 0x17 - V %
42-
const uint8_t OXYGEN_SENSOR_5_A = 24; // 0x18 - V %
43-
const uint8_t OXYGEN_SENSOR_6_A = 25; // 0x19 - V %
44-
const uint8_t OXYGEN_SENSOR_7_A = 26; // 0x1A - V %
45-
const uint8_t OXYGEN_SENSOR_8_A = 27; // 0x1B - V %
46-
const uint8_t OBD_STANDARDS = 28; // 0x1C - bit encoded
38+
const uint8_t OXYGEN_SENSOR_1_A = 20; // 0x14 - V %
39+
const uint8_t OXYGEN_SENSOR_2_A = 21; // 0x15 - V %
40+
const uint8_t OXYGEN_SENSOR_3_A = 22; // 0x16 - V %
41+
const uint8_t OXYGEN_SENSOR_4_A = 23; // 0x17 - V %
42+
const uint8_t OXYGEN_SENSOR_5_A = 24; // 0x18 - V %
43+
const uint8_t OXYGEN_SENSOR_6_A = 25; // 0x19 - V %
44+
const uint8_t OXYGEN_SENSOR_7_A = 26; // 0x1A - V %
45+
const uint8_t OXYGEN_SENSOR_8_A = 27; // 0x1B - V %
46+
const uint8_t OBD_STANDARDS = 28; // 0x1C - bit encoded
4747
const uint8_t OXYGEN_SENSORS_PRESENT_4_BANKS = 29; // 0x1D - bit encoded
48-
const uint8_t AUX_INPUT_STATUS = 30; // 0x1E - bit encoded
49-
const uint8_t RUN_TIME_SINCE_ENGINE_START = 31; // 0x1F - sec
50-
51-
const uint8_t SUPPORTED_PIDS_21_40 = 32; // 0x20 - bit encoded
52-
const uint8_t DISTANCE_TRAVELED_WITH_MIL_ON = 33; // 0x21 - km
53-
const uint8_t FUEL_RAIL_PRESSURE = 34; // 0x22 - kPa
54-
const uint8_t FUEL_RAIL_GUAGE_PRESSURE = 35; // 0x23 - kPa
55-
const uint8_t OXYGEN_SENSOR_1_B = 36; // 0x24 - ratio V
56-
const uint8_t OXYGEN_SENSOR_2_B = 37; // 0x25 - ratio V
57-
const uint8_t OXYGEN_SENSOR_3_B = 38; // 0x26 - ratio V
58-
const uint8_t OXYGEN_SENSOR_4_B = 39; // 0x27 - ratio V
59-
const uint8_t OXYGEN_SENSOR_5_B = 40; // 0x28 - ratio V
60-
const uint8_t OXYGEN_SENSOR_6_B = 41; // 0x29 - ratio V
61-
const uint8_t OXYGEN_SENSOR_7_B = 42; // 0x2A - ratio V
62-
const uint8_t OXYGEN_SENSOR_8_B = 43; // 0x2B - ratio V
63-
const uint8_t COMMANDED_EGR = 44; // 0x2C - %
64-
const uint8_t EGR_ERROR = 45; // 0x2D - %
65-
const uint8_t COMMANDED_EVAPORATIVE_PURGE = 46; // 0x2E - %
66-
const uint8_t FUEL_TANK_LEVEL_INPUT = 47; // 0x2F - %
67-
const uint8_t WARM_UPS_SINCE_CODES_CLEARED = 48; // 0x30 - count
68-
const uint8_t DIST_TRAV_SINCE_CODES_CLEARED = 49; // 0x31 - km
69-
const uint8_t EVAP_SYSTEM_VAPOR_PRESSURE = 50; // 0x32 - Pa
70-
const uint8_t ABS_BAROMETRIC_PRESSURE = 51; // 0x33 - kPa
71-
const uint8_t OXYGEN_SENSOR_1_C = 52; // 0x34 - ratio mA
72-
const uint8_t OXYGEN_SENSOR_2_C = 53; // 0x35 - ratio mA
73-
const uint8_t OXYGEN_SENSOR_3_C = 54; // 0x36 - ratio mA
74-
const uint8_t OXYGEN_SENSOR_4_C = 55; // 0x37 - ratio mA
75-
const uint8_t OXYGEN_SENSOR_5_C = 56; // 0x38 - ratio mA
76-
const uint8_t OXYGEN_SENSOR_6_C = 57; // 0x39 - ratio mA
77-
const uint8_t OXYGEN_SENSOR_7_C = 58; // 0x3A - ratio mA
78-
const uint8_t OXYGEN_SENSOR_8_C = 59; // 0x3B - ratio mA
79-
const uint8_t CATALYST_TEMP_BANK_1_SENSOR_1 = 60; // 0x3C - °C
80-
const uint8_t CATALYST_TEMP_BANK_2_SENSOR_1 = 61; // 0x3D - °C
81-
const uint8_t CATALYST_TEMP_BANK_1_SENSOR_2 = 62; // 0x3E - °C
82-
const uint8_t CATALYST_TEMP_BANK_2_SENSOR_2 = 63; // 0x3F - °C
83-
84-
const uint8_t SUPPORTED_PIDS_41_60 = 64; // 0x40 - bit encoded
48+
const uint8_t AUX_INPUT_STATUS = 30; // 0x1E - bit encoded
49+
const uint8_t RUN_TIME_SINCE_ENGINE_START = 31; // 0x1F - sec
50+
51+
const uint8_t SUPPORTED_PIDS_21_40 = 32; // 0x20 - bit encoded
52+
const uint8_t DISTANCE_TRAVELED_WITH_MIL_ON = 33; // 0x21 - km
53+
const uint8_t FUEL_RAIL_PRESSURE = 34; // 0x22 - kPa
54+
const uint8_t FUEL_RAIL_GUAGE_PRESSURE = 35; // 0x23 - kPa
55+
const uint8_t OXYGEN_SENSOR_1_B = 36; // 0x24 - ratio V
56+
const uint8_t OXYGEN_SENSOR_2_B = 37; // 0x25 - ratio V
57+
const uint8_t OXYGEN_SENSOR_3_B = 38; // 0x26 - ratio V
58+
const uint8_t OXYGEN_SENSOR_4_B = 39; // 0x27 - ratio V
59+
const uint8_t OXYGEN_SENSOR_5_B = 40; // 0x28 - ratio V
60+
const uint8_t OXYGEN_SENSOR_6_B = 41; // 0x29 - ratio V
61+
const uint8_t OXYGEN_SENSOR_7_B = 42; // 0x2A - ratio V
62+
const uint8_t OXYGEN_SENSOR_8_B = 43; // 0x2B - ratio V
63+
const uint8_t COMMANDED_EGR = 44; // 0x2C - %
64+
const uint8_t EGR_ERROR = 45; // 0x2D - %
65+
const uint8_t COMMANDED_EVAPORATIVE_PURGE = 46; // 0x2E - %
66+
const uint8_t FUEL_TANK_LEVEL_INPUT = 47; // 0x2F - %
67+
const uint8_t WARM_UPS_SINCE_CODES_CLEARED = 48; // 0x30 - count
68+
const uint8_t DIST_TRAV_SINCE_CODES_CLEARED = 49; // 0x31 - km
69+
const uint8_t EVAP_SYSTEM_VAPOR_PRESSURE = 50; // 0x32 - Pa
70+
const uint8_t ABS_BAROMETRIC_PRESSURE = 51; // 0x33 - kPa
71+
const uint8_t OXYGEN_SENSOR_1_C = 52; // 0x34 - ratio mA
72+
const uint8_t OXYGEN_SENSOR_2_C = 53; // 0x35 - ratio mA
73+
const uint8_t OXYGEN_SENSOR_3_C = 54; // 0x36 - ratio mA
74+
const uint8_t OXYGEN_SENSOR_4_C = 55; // 0x37 - ratio mA
75+
const uint8_t OXYGEN_SENSOR_5_C = 56; // 0x38 - ratio mA
76+
const uint8_t OXYGEN_SENSOR_6_C = 57; // 0x39 - ratio mA
77+
const uint8_t OXYGEN_SENSOR_7_C = 58; // 0x3A - ratio mA
78+
const uint8_t OXYGEN_SENSOR_8_C = 59; // 0x3B - ratio mA
79+
const uint8_t CATALYST_TEMP_BANK_1_SENSOR_1 = 60; // 0x3C - °C
80+
const uint8_t CATALYST_TEMP_BANK_2_SENSOR_1 = 61; // 0x3D - °C
81+
const uint8_t CATALYST_TEMP_BANK_1_SENSOR_2 = 62; // 0x3E - °C
82+
const uint8_t CATALYST_TEMP_BANK_2_SENSOR_2 = 63; // 0x3F - °C
83+
84+
const uint8_t SUPPORTED_PIDS_41_60 = 64; // 0x40 - bit encoded
8585
const uint8_t MONITOR_STATUS_THIS_DRIVE_CYCLE = 65; // 0x41 - bit encoded
86-
const uint8_t CONTROL_MODULE_VOLTAGE = 66; // 0x42 - V
87-
const uint8_t ABS_LOAD_VALUE = 67; // 0x43 - %
86+
const uint8_t CONTROL_MODULE_VOLTAGE = 66; // 0x42 - V
87+
const uint8_t ABS_LOAD_VALUE = 67; // 0x43 - %
8888
const uint8_t FUEL_AIR_COMMANDED_EQUIV_RATIO = 68; // 0x44 - ratio
89-
const uint8_t RELATIVE_THROTTLE_POSITION = 69; // 0x45 - %
90-
const uint8_t AMBIENT_AIR_TEMP = 70; // 0x46 - °C
91-
const uint8_t ABS_THROTTLE_POSITION_B = 71; // 0x47 - %
92-
const uint8_t ABS_THROTTLE_POSITION_C = 72; // 0x48 - %
93-
const uint8_t ACCELERATOR_PEDAL_POSITION_D = 73; // 0x49 - %
94-
const uint8_t ACCELERATOR_PEDAL_POSITION_E = 74; // 0x4A - %
95-
const uint8_t ACCELERATOR_PEDAL_POSITION_F = 75; // 0x4B - %
96-
const uint8_t COMMANDED_THROTTLE_ACTUATOR = 76; // 0x4C - %
97-
const uint8_t TIME_RUN_WITH_MIL_ON = 77; // 0x4D - min
98-
const uint8_t TIME_SINCE_CODES_CLEARED = 78; // 0x4E - min
99-
const uint8_t MAX_VALUES_EQUIV_V_I_PRESSURE = 79; // 0x4F - ratio V mA kPa
100-
const uint8_t MAX_MAF_RATE = 80; // 0x50 - g/s
101-
const uint8_t FUEL_TYPE = 81; // 0x51 - ref table
102-
const uint8_t ETHONOL_FUEL_PERCENT = 82; // 0x52 - %
103-
const uint8_t ABS_EVAP_SYS_VAPOR_PRESSURE = 83; // 0x53 - kPa
104-
const uint8_t EVAP_SYS_VAPOR_PRESSURE = 84; // 0x54 - Pa
89+
const uint8_t RELATIVE_THROTTLE_POSITION = 69; // 0x45 - %
90+
const uint8_t AMBIENT_AIR_TEMP = 70; // 0x46 - °C
91+
const uint8_t ABS_THROTTLE_POSITION_B = 71; // 0x47 - %
92+
const uint8_t ABS_THROTTLE_POSITION_C = 72; // 0x48 - %
93+
const uint8_t ACCELERATOR_PEDAL_POSITION_D = 73; // 0x49 - %
94+
const uint8_t ACCELERATOR_PEDAL_POSITION_E = 74; // 0x4A - %
95+
const uint8_t ACCELERATOR_PEDAL_POSITION_F = 75; // 0x4B - %
96+
const uint8_t COMMANDED_THROTTLE_ACTUATOR = 76; // 0x4C - %
97+
const uint8_t TIME_RUN_WITH_MIL_ON = 77; // 0x4D - min
98+
const uint8_t TIME_SINCE_CODES_CLEARED = 78; // 0x4E - min
99+
const uint8_t MAX_VALUES_EQUIV_V_I_PRESSURE = 79; // 0x4F - ratio V mA kPa
100+
const uint8_t MAX_MAF_RATE = 80; // 0x50 - g/s
101+
const uint8_t FUEL_TYPE = 81; // 0x51 - ref table
102+
const uint8_t ETHONOL_FUEL_PERCENT = 82; // 0x52 - %
103+
const uint8_t ABS_EVAP_SYS_VAPOR_PRESSURE = 83; // 0x53 - kPa
104+
const uint8_t EVAP_SYS_VAPOR_PRESSURE = 84; // 0x54 - Pa
105105
const uint8_t SHORT_TERM_SEC_OXY_SENS_TRIM_1_3 = 85; // 0x55 - %
106106
const uint8_t LONG_TERM_SEC_OXY_SENS_TRIM_1_3 = 86; // 0x56 - %
107107
const uint8_t SHORT_TERM_SEC_OXY_SENS_TRIM_2_4 = 87; // 0x57 - %
108108
const uint8_t LONG_TERM_SEC_OXY_SENS_TRIM_2_4 = 88; // 0x58 - %
109-
const uint8_t FUEL_RAIL_ABS_PRESSURE = 89; // 0x59 - kPa
109+
const uint8_t FUEL_RAIL_ABS_PRESSURE = 89; // 0x59 - kPa
110110
const uint8_t RELATIVE_ACCELERATOR_PEDAL_POS = 90; // 0x5A - %
111-
const uint8_t HYBRID_BATTERY_REMAINING_LIFE = 91; // 0x5B - %
112-
const uint8_t ENGINE_OIL_TEMP = 92; // 0x5C - °C
113-
const uint8_t FUEL_INJECTION_TIMING = 93; // 0x5D - °
114-
const uint8_t ENGINE_FUEL_RATE = 94; // 0x5E - L/h
115-
const uint8_t EMISSION_REQUIREMENTS = 95; // 0x5F - bit encoded
111+
const uint8_t HYBRID_BATTERY_REMAINING_LIFE = 91; // 0x5B - %
112+
const uint8_t ENGINE_OIL_TEMP = 92; // 0x5C - °C
113+
const uint8_t FUEL_INJECTION_TIMING = 93; // 0x5D - °
114+
const uint8_t ENGINE_FUEL_RATE = 94; // 0x5E - L/h
115+
const uint8_t EMISSION_REQUIREMENTS = 95; // 0x5F - bit encoded
116116

117-
const uint8_t SUPPORTED_PIDS_61_80 = 96; // 0x60 - bit encoded
117+
const uint8_t SUPPORTED_PIDS_61_80 = 96; // 0x60 - bit encoded
118118
const uint8_t DEMANDED_ENGINE_PERCENT_TORQUE = 97; // 0x61 - %
119-
const uint8_t ACTUAL_ENGINE_TORQUE = 98; // 0x62 - %
120-
const uint8_t ENGINE_REFERENCE_TORQUE = 99; // 0x63 - Nm
121-
const uint8_t ENGINE_PERCENT_TORQUE_DATA = 100; // 0x64 - %
122-
const uint8_t AUX_INPUT_OUTPUT_SUPPORTED = 101; // 0x65 - bit encoded
119+
const uint8_t ACTUAL_ENGINE_TORQUE = 98; // 0x62 - %
120+
const uint8_t ENGINE_REFERENCE_TORQUE = 99; // 0x63 - Nm
121+
const uint8_t ENGINE_PERCENT_TORQUE_DATA = 100; // 0x64 - %
122+
const uint8_t AUX_INPUT_OUTPUT_SUPPORTED = 101; // 0x65 - bit encoded
123123

124124

125125

126126

127127
//-------------------------------------------------------------------------------------//
128128
// Class constants
129129
//-------------------------------------------------------------------------------------//
130-
const uint8_t QUERY_LEN = 6;
131-
const uint8_t HEADER_LEN = 6;
132-
const uint8_t SERVICE_LEN = 2;
133-
const uint8_t PID_LEN = 2;
134-
const uint8_t MAX_PAYLOAD_LEN = 25;
130+
const uint8_t QUERY_LEN = 6;
131+
const uint8_t HEADER_LEN = 6;
132+
const uint8_t SERVICE_LEN = 2;
133+
const uint8_t PID_LEN = 2;
134+
const uint8_t MAX_PAYLOAD_LEN = 25;
135135

136136

137137

@@ -143,7 +143,7 @@ class ELM327
143143

144144
String temp;
145145

146-
// timeout in ms
146+
// timeout in ms
147147
uint16_t timeout_ms = 100;
148148

149149
uint32_t currentTime;

0 commit comments

Comments
 (0)