You can change the array sizes in the SimpleTimer library code and recompile it to provide as many timers as you need, but perhaps using a second timer object to provide 10 more timers is easier.
There are any number of uses for timers that can deliver a ‘message’ to the callback function, such as one callback that could handle several similar buttons, LEDs, or whatevers. There is a library similar to SimpleTimer, called ‘Timer’ that takes an unsgined int argument which it eventually passes to the callback function. (Of course, each timer’s storage must increase 2 bytes due to that.) I’ve modified my library’s SimpleTimer to take & pass a byte argument, solely because SimpleTimer is currently better known (and because I could live with 8-bit messages).
I think I can do it with global variable, function x (param a, param b) inside function y, param a, b asign to global variable c, d blah, blah… and than asign function y into Simple Timer. Is it possible?
Just happened across this thread. The original author of SimpleTimer and I upgraded the original SimpleTimer code so the called functions can take a void pointer. A void pointer can be cast to an int, char, etc or to the address of a structure holding more information (take care here, the referenced data must still be in scope). The upgraded code can be found at: https://github.com/marcelloromani/Arduino-SimpleTimer/tree/feature/simpleTimerPlus/SimpleTimer
The upgrade adds this feature. The original functionality is still there.
Regards
-Bill K
ROSoftWare
Blynk has recently merged a modified version directly into Blynk so external SimpleTimer library is not required (and will just be ignored). I don’t know if it supports the referenced void pointer… @vshymanskyy ?
The merged version of SimpleTimer appears to be just a rename and does not support args to the callback functions. It even references the SimpleTimer documentation at http://playground.arduino.cc/Code/SimpleTimer for usage. The updated version of SimpleTimer which does support args to the callback functions and is also backwards compatible with the current usage is available at https://github.com/marcelloromani/Arduino-SimpleTimer/tree/master/SimpleTimer.
Regards
-Bill K
R O SoftWare