Thread: MPH code?
View Single Post
Old 12-08-2011, 01:09 PM   #4 (permalink)
Sebastian
EcoModding Lurker
 
Join Date: Oct 2009
Location: Austria
Posts: 28
Thanks: 0
Thanked 1 Time in 1 Post
Oh, I mixed up mph and gph

Code:
unsigned long instantvehiclespeed(){
  if (instant.vssPulses == 0) return 0;
  return 1000000000ul / parms[VSS_PULSES_PER_KM_IDX] * 3600 / (instant.vssPulseLength / instant.vssPulses);
}
But you should have a look in the mpguino code on your own to see how vssPulseLength and vssPulses are measured! It's a lot more than a single code block..
  Reply With Quote