- Thu Feb 13, 2014 8:25 pm
Got an adapter model A just yesterday, and now I have some questions! :D
So, for starters, I used the OBD.h library and the example sketch and it worked great. I mean, not the exact same sketch, but with the same PID, and outputed the RPM value to a LiquidCrystal LCD. Everything good so far.
But things started to de-rail right away.
When I tried to also see the Throttle Position PID, the reading was erroneous (like it outputed 18% at rest, and 22% at full throttle).
But that wasn't a big of a problem.
The big things was, I tried to put the LCD to display RPM, Ambient Temp, Oil Temp and HorsePower (dfrobot is calculated through torque).
Only the RPM is displayed, and all the other values stay at 0.
I commented everything except the Ambient Temp and tried it again and it now outputed that temp correctly.
I suppose using several PID readings at the same time messes things up, but I have no idea if that's the case, or how to fix it.
My code is here: (I know you won't probably like the If/else statements in there, but it was for formating the output on the LCD. I tested them independantly and they work perfectly, I may change them but only after I manage to deal with this issue :D )
LiquidCrystal lcd(8, 13, 9, 4, 5, 6, 7);
dfrobot = ((trq * 0.737) * rpm) / 5252;
if (tmp > 9)
else if (tmp < 10)
if (dfrobot >= 100)
else if (dfrobot > 9)
else if (dfrobot < 10)
Anyone knows what's going on? Or has the chance to test this?
BTW, the LCD is the SainSmart LCD Keypad Shield, which is a LiquidCrystal display (16x2).