View Single Post
Old 04-11-2008, 10:20 AM   #12 (permalink)
dcb
needs more cowbell
 
dcb's Avatar
 
Join Date: Feb 2008
Location: ÿ
Posts: 5,038

pimp mobile - '81 suzuki gs 250 t
90 day: 96.29 mpg (US)

schnitzel - '01 Volkswagen Golf TDI
90 day: 53.56 mpg (US)
Thanks: 158
Thanked 269 Times in 212 Posts
Whoops, the occasional sampling of the injectors would be reasonably accurate, but then you need to add tight timing control around the code that would enable the timer interrupts and disable them. And then make an exception for the vss signal, because on my vehicle, it is more than a second between pulses at low speed and you wouldn't want to miss one of those.

I don't think it would make it more straightforward though, since it adds code, but it would be a good optimization, a strategy to consider if reacting to the button presses and displaying prove to be too time consuming. But I think we are ok and might even be able to shorten the 1 second display rate and keep microsecond accuracy.

if you wanted to plug into the serial processor as it stands today:
http://ecomodder.com/forum/showthrea...7979#post17979
Basically in the middle of loop, get rid of the serial calls and replace it with

updateTrips(tmpInjHiMS, tmpInjCount, tmpvssCount );//quick addition in the trip objects
updateDisplay()



updateTrips might look like:
void updateTrips(long injHiMS, injCount, vssCount ){
instant.reset();
instant.update(injHiMS,injCount,vssCount);
current.update(injHiMS,injCount,vssCount);
tank.update(injHiMS,injCount,vssCount);
trip1.update(injHiMS,injCount,vssCount);
trip2.update(injHiMS,injCount,vssCount);
}

and the trips themselves would provide functions like:
current.mpg(), instant.kph(), instant.mph(), tank.dte(), trip1.lper100km()

now updateDisplay() is tricky, as well as keeping track of the button interrupts and deciding the next screen. Might want to look at how coyote did his for starters.
__________________
WINDMILLS DO NOT WORK THAT WAY!!!
  Reply With Quote