dynamic array? or varrying the size of the array based on something?

PaulS:

right now the ISR changes the position of itself in the array and i want to keep that code small so i dont possibly miss any other interupts.

No, it doesn't. The ISR is a function. It is not an array element, so it can't move itself in the array.

There are ways to dynamically define arrays. You are advised not to use them. The Arduino (328-based, anyway) has little memory. Fragmenting that doing dynamic memory allocation is not advised. Clearly, you are not using a 328 based Arduino, since it does not have 4 interrupt pins. Still, small, static arrays are best.

what do you mean it doesnt?

  nowPulse2 = micros();
  pulse2[pIndex2] = nowPulse2 - lastPulse2;
  pIndex2++;
  if (pIndex2 > SnumRead)
    pIndex2 = 0;
  lastPulse2 = nowPulse2;
  nowPulse2 = 0;

it seems like its populating the various slots in the array. if i change the sample size it makes a difference.

dhenry:

is it possible?

Yes.

My project measures wheel speed by measuring time between interrupts. At low speed (<20hz) its fairly accurate and i can use a small array of 1 or 2 readings for fast response; but at 800hz and up i need a bigger array (8-10) to smooth out the readings.

You do not need such (large) arrays to measure wheel speed. Maybe you want to rethink your approach instead.

care to elaborate on this? i need fairly high resolution (measure slip in 1/10 of a percent) so i'm measruring time between pulses. the way i have it setup works great but at high speed the small size of the array leads to some big jumps; upping the size makes it happier.

/edit: my first attempt was just counting pulses but at low speed the reaction was way too slow; i need to update the output based on slip at least every 10ms (100hz). even at 20hz there wasn't enough pulses to have enough resolution to have useful data. this timing of pullses works much better.

i think i have an idea though; leave the array with 8 spaces but at low speed only use the first 2 then at higher speed maybe 4 then highest speed use all 8. i'll have to try it but i think it'll work better than trying to reallocate memory