Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ Code:
```
//Request MODE 1, PID 0C - RPM
val pid = PID(ObdModes.MODE_01, "0C")
pid.formula = "(256A+B)/4" // Engine RPM formula https://en.wikipedia.org/wikiOBD-II_PIDs#Service_01
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You dont have to build this PID yourself.

You can request a fully built pid from the built in library this way:

val pid = PIDUtils.getPid(ObdModes.MODE_01, "OC")

pid.bytes="2" // Engine RPM bytes
val command = OBDCommand(pid)
command.run(bluetoothSocket.inputStream, bluetoothSocket.outputStream)

command.run(mBtSocket.inputStream, mBtSocket.outputStream)
Log.d("PID", "${pid.description} : ${pid.calculatedResult}")
Log.d("PID Formatted Result", command.formattedResult)
```
Expand Down