Hi,
I've got OBD2 library from Freematics OBD-II Adapter for Arduino | ArduinoDev.com
It's display data correctly, I've try it earlier, and it works out of the box. Yes I know that this two variables are not defined, but it doesn't change anything.
Truthly I doubt that this change is necessary. As I understand this line it's try initiate obd until it finish success, and this is executed only once on start. So when I received this one value, this means obd was initialized successfully.
marcin_i:
Yes I know that this two variables are not defined, but it doesn't change anything.
Well, it does change something because the fact that the sketch doesn't compile means it can't possibly demonstrate the problem. You need to post your actual sketch.
Which Arduino are you running this code on? For a 328-based Arduino, the SD library takes up more than 1/4 of the memory, because it actually writes to the card in 512 byte chunks.
The streaming library also use a fair amount of memory holding the data to be streamed.
My suspicion is that you are running out of memory.
Google the site for FreeMemory(). Start getting rid of libraries you don't really need. Start with the Streaming one. The SD card doesn't care whether the data gets there because of one function call or 12 function calls.
Ok I found some function which counts how many free memory I have. And the result was 638 bytes of free memory. I'm still a beginner in arduino and it hard to say for me is it big or small.
This is supported because of the Streaming library. You do not explicitly include the Streaming library, so either SdFat or OBD is, although that should not be possible.
Hi,
I think I found root of this problem. OBD2 library which I use somehow doesn't allow me to read more than one PID. When I want to read two or more it reads only the first one. Now the tricky part. Does anyone of you have any idea how to solve this issue.
The library intro at link you provided implies that the library can read multiple sensors, although their example there doesn't show it. Look at the dashboard_1602 example though and you see that multiple PIDs are being read, corresponding to which mode the device is in.
I suggest you try writing a minimalist program that reads two pids and displays the result, on the serial port for preference, and build up from there.