pulse counting

I want to count how many times a transistor triggers per minute. It's important to not miss any triggers, so my assumption is that an interrupt is necessary. I've never used interrupts. I'm using a Arduino 2560, and a TCRT5000 IR emitter / photo transistor that is reading a reflective patch on a rotating shaft (One trigger per revolution, want to display RPM). It makes sense to me to count pulses per second and calculate RPM. RPM could be as low as 100 or as high as 10,000

What's the best way (accuracy) to go about this?

Something to get ya started. Personally, I would use a VR (Variable Reluctance) or Hall sensor, however what you have will work as well.

// Globals (or ...)
#define PPR 1 // Pulses Per Revolution ... How many triggers per rotation.
#define PPR_M 60000 / PPR
volatile unsigned int vuiTriggerCount = 0;
unsigned int uiRevsPerMin = 0;
unsigned long ulLastRPMTime = 0;

// Global
void trigger_counter()
{
  vuiTriggerCount++;
}

// Global
void RPM()
{ // Check the math ... I ain't so good at it!
  uiRevsPerMin = vuiTriggerCount / (millis() - ulLastRPMTime) * PPR_M;
  ulLastRPMTime = millis();
  vuiTriggerCount = 0;
}

 // Add to setup() (or ...)
  attachInterrupt(RPMINT, trigger_counter, RISING);

In your loop add a call to RPM(), I highly recommend that you place the call to RPM within a conditional statement of either a counter or timer so it does not get called every time through the loop.

-Enjoy fh : )_~