irvined1982 / arduino-ELM327

ELM327 Library for Arduino
GNU General Public License v2.0
69 stars 31 forks source link

May I have a code example, please? #7

Open mprowe opened 6 years ago

mprowe commented 6 years ago

Hi, Could you offer an example to show how to call the getVersion() method? With my very limited understanding of C/C++ I have tried this:

    String rev;
    Elm.getVersion(rev);
    Serial1.println(rev);        //Serial1 is not the UART talking to the STN1110

Which compiles and runs but does not return the correct string (it returns "OK" instead of "ELM327..."). My problem is that I do not understand the "(String& rev)" in the method signature. Best regards, Martin

RootUser3885 commented 6 years ago

Same, having issues setting the baud to 38400 instead of 9600. My adapter is default 38400.