-
Notifications
You must be signed in to change notification settings - Fork 520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to check if the vehicle is running? #53
Comments
I recalled tried recalling |
The easiest way to know if the car is on is by checking the rpms. The value for this comes from the crank sensor so if it's failing you'll know it because it won't show revs and you also know the car is on. When you tried calling |
Well, I was looking to count the number of times the vehicle is turned on and off (and trigger events as states change). For example, I want to call this function each time the vehicle is turned on:
Right now, my loop function looks something like this, where I check the previous state against the current state and check different things based on that state. Unfortunately, the state does not change when the vehicle is turned off.
I thought maybe the OBD-II port was still active when the vehicle was off, but the Arduino cannot connect to the OBD-II from power on when the vehicle is off and returned values from However, if there is another method to manage vehicle state other than |
So what happens is that the Arduino is always receiving power from the port so it never really "turns off", it only disconnects because the key is no longer on run and the ecu power is cut. After that, all the values are still stored in the Arduino but not cleared, that's why the states don't change. Also, it doesn't change the state because of that like you said. I looked a bit through the library and it seems as if it returns the values as integers. Edit: I forgot to mention that you could also try |
What is the easiest way to check if the vehicle is still running? I noticed that if I poll data after the vehicle is off, the most recent value is returned, and the OBD state does not change because of this.
The text was updated successfully, but these errors were encountered: