I’d like to setup timed interrupts. Are any of the CPU timers available? If so how do I set the up?
Check out @peekay123’s Interval Timer library
Looks like what I want… tho’ “Advanced programming is required …” gives me pause…
Hmmm… I’m not looking for precise timing, I want a watchdog timer on my network connection. The Spark drops off the network frequently and I thought an interrupt routine can periodically check the connection status and reconnect if needed. I’ll look at the library and see if it will do want I think I need.
Looks like it can be used as a watchdog. I think if I restart the timer each time through loop(), it will only trigger if the communication hangs. I can restart the wifi in the interrupt handler and begin again.
There’s also this library for a more simple abstracted polled timer https://github.com/pkourany/elapsedMillis/blob/master/firmware/examples/elapsedMillisDemo.cpp