2003 Kia rio, havent calc the gal/hr yet, mph spot on out of the box (8204 i believe)
Built my mpGuino, worked perfect for 200 miles, did a tank reset, now the miles per hour are acting funny. Before the tank reset, speed worked perfectly (tested to 90mph). Now if I cross over 80, it starts counting back down, so at 90 on the speedo the guino shows I am doing 70. Worked fine before.
I am using FalconFour's firmware, slightly modified by myself. Here is the code I modified, my edits in
BOLD
Quote:
ignitionState = digitalRead(ignitionPin);
current.update(instant); //use instant to update current
tank.update(instant); //use instant to update tank
// new line of code to wake up and shut down dispay with ignition, connected to pin 11
if (ignitionState != HIGH)
{
OCR1A = brightness[0];
}
else
{
if (ignitionState == HIGH)
OCR1A = brightness[brightnessIdx];
}
//currentTripResetTimeoutUS
if (instant.vssPulses == 0 && instant.injPulses == 0 && holdDisplay
== 0) {
if (elapsedMicroseconds(lastActivity)
> parms[currentTripResetTimeoutUSIdx] && lastActivity
!= nil) {
// analogWrite(BrightnessPin,brightness[0]);
// OCR1A = brightness[0]; //nitey night
lastActivity = nil;
}
}
else {
if (lastActivity == nil) {//wake up!!!
// OCR1A = brightness[brightnessIdx];
// analogWrite(BrightnessPin,brightness[brightnessIdx]);
lastActivity = loopStart;
current.reset();
tank.loopCount = tankHold;
current.update(instant);
tank.update(instant);
}
else {
lastActivity = loopStart;
tankHold = tank.loopCount;
}
}
|
Maybe I can get some input on another issue I am having to the arduino experts here. I want the ignition to reset my trip, overiding the timeout. I tried replacing some of the if/else statements, namely the underlined lines above with ignitionState != HIGH and ignitionState == HIGH, but the current display was broken after, so the code above was improvised with the above. All features work fine except the speed is counting down over 80, which did not happen before I did the tank reset. Could a zener/resistor have popped, or the board itself, or could it be a code issue? Any help would be greatly appreciated.
Some pictures of how I built/installed it for those that are curious. Still need to wire up buttons and click the cover in.
have pictures but need 5 posts to show... I had at least 5 from the last one I did, guess they got reset some how.