Giter Site home page Giter Site logo

Comments (2)

jimwhitelaw avatar jimwhitelaw commented on July 22, 2024 1

The library doesn't support that type of query using processPID(), but you can use it to get the data you want. Instead, use sendCommand(), and then parse the response in your code. The full response from ELM327 will be available to you in myELM327.payload after calling getResponse().

Include something like this in your loop() method:

    myELM327.sendCommand("22242C");
    if (myELM327.nb_rx_state == ELM_SUCCESS)
    {
        myELM327.getResponse();
        // parse and process the values you want from myELM327.payload
    }
    else if (myELM327.nb_rx_state != ELM_GETTING_MSG)
    {
        myELM327.printError();
    }

from elmduino.

etnaskynet avatar etnaskynet commented on July 22, 2024

IT WORKS.
I used this code:

DPF_KM = myELM327.processPID(34, 9556, 4, 4, 1, 0); //PID 222554; Equation: ((A256)+B)
if (myELM327.nb_rx_state == ELM_SUCCESS)
{
D = myELM327.responseByte_0;
C = myELM327.responseByte_1;
B = myELM327.responseByte_2;
A = myELM327.responseByte_3;
DPF_KM_calc = ((C
256)+D);
obd_state= ENG_RPM;
}

and I retrieved the correct data (verified) in Arduino Serial Monitor:
Delimited found.
All chars received: 6225540139
Expected response header: 622554
Single response detected
64-bit response:
responseByte_0: 57
responseByte_1: 0
responseByte_2: 0
responseByte_3: 0
responseByte_4: 0
responseByte_5: 0
responseByte_6: 0
responseByte_7: 0
Service: 34
PID: 9556
Long query detected
Query string: 222554
Clearing input serial buffer
Sending the following command/query: 222554
Received char: 6
Received char: 2
Received char: 2
Received char: 5
Received char: 5
Received char: 4
Received char: 0
Received char: 1
Received char: 3
Received char: 9
Received char: \r

So, after conversion, the KM from last regeneration are 313.

Thanks a lot for your support!

from elmduino.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.