Timer1 help


I need a way to start and stop the timer1 attach function in my loop. The function:

 Timer1.attachInterrupt(myFunction, Period)

is declared in the setup routine. I have the period to 1000 micro seconds, because I need this myFunction to run every ms. However I need a way to enable and disable this functionality of timer1 in my loop routine.

Any ideas? or a better way?


Any ideas?

Well, that would depend on what Timer1 is an instance of. We don't do snippets here.

This is timer1: http://www.arduino.cc/playground/code/timer1

That page lists methods like start() and stop(). They appear, to me, to be what you need to start and stop your timer. Obviously, stopped timers stop firing their events.