I've written ( in C ) a nice timer function for another platform using a timer interrupt for it's clock. I'd like to port this into the arduino by generating a library. Very useful for state machines.
How can I do this?
regards
Allan.
I've written ( in C ) a nice timer function for another platform using a timer interrupt for it's clock. I'd like to port this into the arduino by generating a library. Very useful for state machines.
How can I do this?
regards
Allan.
Is google broken in your country?
No - not yet. The problem is how to make the timer interrupt run from within from the library - using eg millis() without invoking it in the main loop() of the user program...
I must seem very stupid - I've written loads of C but no C++
Allan.
allanhurst:
No - not yet. The problem is how to make the timer interrupt run from the library - using eg millis()
without including it in the main loop() of the user program...I must seem very stupid - I've written loads of C but no c++
Allan.
well, you could post what you've tried, or your original code of your nice timer function
Or copy the code you find in other similar libraries. Look at TimerOne and its friends.