converting delay code to interrupt:Metronome

Do you REALLY want to use interrupts, or do you just want to avoid the use of "delay" so that you can do other things. If you DO use a real timer interrupt, you'll conflict with the arduino environment's (potential) use of those timers for PWM and such. That's OK, but you might get by with using the existing timer interrupt indirectly, something like:

unsigned long nexttick;
unsigned char tickstate;

loop() {
   if (millis() >= nexttick) {      /* See if it's time for a "tick." */
       if (tickstate == LOW) {  /* reverse state of pin */
         digitalWrite(ledPin, HIGH);
         tickstate = HIGH;
       } else {
         digitalWrite(ledPin, LOW);
         tickstate = LOW;
       }
       nexttick += calc(val);
   }
   /*
    * no tick, or tick finished.  We can do other things as long
    * as they don't take too long.
    */   
}

The technique of computing a time in the future and comparing agains millis() is essentially how delay() works internally, by the way.

The easiest way to break into "real" interrupts would probably be to modify the arduino support code in .../lib/targets/arduino/wiring.c; you can attach your code to the same function that modifies timer0_overflow_count