0
I’m doing a program on Arduino. I’m using the Freematics OBDII (UART) adapter. They’ve developed a specific library. There is a problem: trying to read a PID, which returns me 2 bytes with a value between 0 and 65535. It was supposed to store this value in an unsigned int variable (0 to 65535). But the function that makes me return this value only accepts variables of type int(-32768 to 32767). What is the solution? Rectify the entire library? Somehow fetch the value without using the function?
Function -> obd.readPID("pid", "variable") // obd.readPID(PID_RUNTIME, tempo_motor);
COBD::readPID(byte pid, int& result)
Library -> https://github.com/stanleyhuangyc/ArduinoOBD/tree/master/libraries/OBD2UART
When running the program, with the adapter connected to the car, when it reaches this line of code the program simply stops (it keeps trying to read the value of the PID) and ends up passing to the next line of code. If you use a variable other than the int the following error appears:
exit status 1
no matching function for call to 'COBD::readPID(int, unsigned int&)
Well, in this case you are saying that there is no such function to call... You imported all the correct libs ?
– Dev
I think so. On the Freematics website (adapter developers) and on Github it was just what I found.
– Jorge Santos