Rpm counter IR tachometer - Help needed

Revs per minute = #revs  * ( 1/(time interval, in minutes) )

Which translates to the following based on the example provided by the OP.

rpm = rpmcount * ( 1/( (millis()-timeold)/1000/60 )

(note rpmcount is a bad choice as its really a timeinterval count not an rpm count)

...the time interval is in milliseconds, so we have to divide it by 1000 to get to seconds and then 60 to get to minutes). This example assumes one interrupt per revolution.

When there are 2 interrupts per revolution( ie 2 blades rotating) then the rpmcount value should be divided by 2.

So the above can then be re-written as:

rpm = rpmcount/2 * ( 1/( (millis()-timeold)/1000/60 )

which is the same as

rpm = rpmcount * ( 1/( (millis()-timeold)/1000/30 )

which is the same as

rpm = rpmcount * 30 *1000/(millis()-timeold)

Hope that helps?