Skip to content

Commit 63c85f6

Browse files
author
Brendan Whitfield
committed
readme updates, fixed typo
1 parent 5d5d5d9 commit 63c85f6

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,20 @@ Commands can also be accessed explicitly, either by name, or by code value. The
5252

5353
connection = obd.OBD()
5454

55-
if connection.has_command(obd.commands.RPM): # check for existance of sensor
56-
print connection.query(obd.commands.RPM) # get and print value of sensor
55+
56+
c = obd.commands.RPM
57+
58+
# OR
59+
60+
c = obd.commands['RPM']
61+
62+
# OR
63+
64+
c = obd.commands[1][12] # mode 1, PID 12 (decimal)
65+
66+
67+
if connection.has_command(c): # check for existance of sensor
68+
print connection.query(c).value # get and print value of sensor
5769

5870

5971
Here are a few of the currently supported commands (for a full list, see commands.py):
@@ -76,7 +88,7 @@ Here are a few of the currently supported commands (for a full list, see command
7688
+ Number of warm-ups since codes cleared
7789
+ Distance traveled since codes cleared
7890
+ Evaporative system vapor pressure
79-
+ Baromtric Pressure
91+
+ Barometric Pressure
8092
+ Control module voltage
8193
+ Relative throttle position
8294
+ Ambient air temperature

obd/commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def compute(self, _data):
151151
OBDCommand("WARMUPS_SINCE_DTC_CLEAR" , "Number of warm-ups since codes cleared" , "01", "30", 1, count ),
152152
OBDCommand("DISTANCE_SINCE_DTC_CLEAR" , "Distance traveled since codes cleared" , "01", "31", 2, distance ),
153153
OBDCommand("EVAP_VAPOR_PRESSURE" , "Evaporative system vapor pressure" , "01", "32", 2, evap_pressure ),
154-
OBDCommand("BAROMETRIC_PRESSURE" , "Baromtric Pressure" , "01", "33", 1, pressure ),
154+
OBDCommand("BAROMETRIC_PRESSURE" , "Barometric Pressure" , "01", "33", 1, pressure ),
155155
OBDCommand("O2_S1_WR_CURRENT" , "02 Sensor 1 WR Lambda Current" , "01", "34", 4, current_centered ),
156156
OBDCommand("O2_S2_WR_CURRENT" , "02 Sensor 2 WR Lambda Current" , "01", "35", 4, current_centered ),
157157
OBDCommand("O2_S3_WR_CURRENT" , "02 Sensor 3 WR Lambda Current" , "01", "36", 4, current_centered ),

0 commit comments

Comments
 (0)