Open benjaminBrownlee opened 6 years ago
In terms of hardware, if you are trying to quickly see if the vehicle is off, you could poll for voltages on the ignition switch (or perhaps the data lines) and then attach that to one of the Arduino's inputs, using proper protection where appropriate. Then adding a "kill switch" to the code would tell you instantly if the car is off. No voltage, the car must be off.
I noticed that if the OBD-II has stopped communication with the adapter, it takes 11 to 15 seconds for methods such as
obd.init
andobd.readPID
to affirm that the vehicle is off. Is there a way to asynchronously connect to the adapter, or at least a quick check mode that takes less than a second?