Go Down

Topic: Timer1 help (Read 598 times) previous topic - next topic

Hi,

I need a way to start and stop the timer1 attach function in my loop.
The function:
Code: [Select]
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?

Thanks

PaulS

Quote
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


PaulS

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.

Go Up