Lets just start with the simple one. Reading from a GM vehicle, pulling speed (doesnt matter if kmh or mph).
case SPEED:
speed = myELM327.mph();
if (myELM327.nb_rx_state == ELM_SUCCESS)
{
Serial.printf("Speed (MPH): %.1f\n", speed);
obd_state = IDLE;
}
else if (myELM327.nb_rx_state != ELM_GETTING_MSG)
{
myELM327.printError();
obd_state = IDLE;
}
The defined value for the speed OBD2 lookup is below which is correct. I've pulled it on my own using without a library using 410D and I can pull speed without this library.
const uint8_t VEHICLE_SPEED = 13; // 0x0D - km/h
For some reason this just doesnt work.
If I use a OBD2 hardware simulator which connects to an ELM327 everything works fine. Is it a protocol issue or? I can read RPM and battery voltage (its off with this library) though.
Should I just ditch this and use my own code?