Hardware idiot check - there is 1.3 volts on pin2 at idle. I am using Analog In pin 2.
Software:
I have added "int press = 0" here:
--------------------
byte screen=0;
byte holdDisplay = 0;
int press = 0; //declare press
#define looptime 1000000ul/loopsPerSecond //1/2 second
void loop (void){
--------------------
Removed the "int" from this line:
-----------------------------------------------------------------------
press = analogRead(2) + 1; //press is common rail pressure approx in bars
-----------------------------------------------------------------------
And modded the display as you suggest.
Press is displaying 0.1 at 1.3 volts, rising to 0.9 max when driving. Maybe a display issue?
InstMPG is zero for any value of "us per gallon" and currentMPG is 999. It looks like it thinks no fuel is being used. Instant raw data shows a "random" value for injus. Could it be that the value is out of range for calcs and for displaying a sensible number?
On the plus side, CPU is now down to 52% from 500%...
Last edited by ecoxantia; 08-29-2008 at 02:53 PM..
|