OBD II loop problem

Hello community
We are 2 guys working on a project, trying to get as much information out of a OBD plug as possible, so far it is going well, but when creating multiple pages for our 16 x 2 display it stops looping, we of course want multiple pages cause space is limited on a 16 x 2 and we have alot of options through OBD :slight_smile:
when we reset, we get an image of what the data at the exact time we started up, but nothing else :confused: does anybody know what we are doing wrong? :slight_smile:

We are very new at this! only been 1 week so please be kind! :wink:

OBD_3_0_NoLive.ino (5.63 KB)

Hi, welcome!

The code seems alright - the only problem could be the return value of the obd.readPID function.

So I spent time finding and reading the library…

bool readPID(byte pid, int& result);

That means that the result is a pointer

So change the code to

if (obd.readPID(PID_RPM, &rpm))

Will this library work with this OBD2 reader ?

@Msquare Cool thank you we will try and return with answer :slight_smile:

@casey-ryback it should if you can connect it with your arduino, OBD II has a bunch of standardised PID´s which is what the library is defining, so should be the same for all methods of connecting to the OBD via can high and low :slight_smile:

That means that the result is a pointer reference.

Yes, "under the skin" it is a pointer, but pointers and references are not the same thing, and are not inter-changeable...

Ray L.