Can I use Arduino OBD library with "custom" software serial or it needs to be used with hardware UART only? For example if I have D5 and D6 pin as RX and TX in my code hooked on OBD board, how do I initialize OBD library from there?
This is the OBD library that I'm referring to.
And I'm using this Allpro OBD board.
Update Actually I would be satisfied with a answer how to know when entire response from the board is received, because this way is way too messy:
void getResponse(void){
while(obdSerial.available()){
Serial.write(obdSerial.read());
}
}
Here I don't know when the message is received. And if I try to use example from Sparkfun obd-ii-uart-hookup-guide (different board doe) I ended up in infinite-loop since the board never return \r
, if I send ELM command to use \n
as terminator, and if I disable ELM to echo the command so that I use just one getResponse
call I get some readings, but not all the time, I ended up in infinite-loop again.