advice needed for arduino as diesel injection brain...

Thanks for your input Paul,

int rpm = 9000.0;
int angle = 30.0;
int ThrottleCalib = 1024.0/(1000000.0/(rpm/60.0)/360.0*angle);

Reason was that I want the calculation to be accurate but the result being rounded up and have no clue how to that otherwise, will search on a float solution.

  pinMode(cyl1, OUTPUT);
  attachInterrupt(0, inject1, RISING);
  pinMode(cyl2, OUTPUT);
  attachInterrupt(1, inject2, RISING);
  pinMode(cyl3, OUTPUT);
  attachInterrupt(2, inject3, RISING);
  pinMode(cyl4, OUTPUT);
  attachInterrupt(3, inject4, RISING);

So this is what I meant? (if INPUT gets high OUTPUT is triggered for all 4 separately)

Why can't I call a delay within the interrupt routine?
Is this not possible or a coding no-no?
Theoretically the interrupt won't be actived before the timer ends, if that happens in practice it means I got 30K rpm and I am pretty sure my rods are a bigger problem then the software if that happens...

p.s. the Sledgehammer pulling team are friends so they won't hit me. :wink: