I am setting up a multi-zone watering scheduler and want to be able to change parameters from a keypad and need to modify the relevant Alarm.timer function parameters from within the code having read those parameters from an SD Card. That will include the alarm times as well as the “void function” name.
Many thanks.
I see no reason to use something like 'the "void function" name'.
Use a single function that selects its action by a global variable that you can set as you like.
There are no names in a C++ program after compilation, so your original plan will not work out.
Maybe on an ESP32 with MicroPython...
You COULD create an array of function pointers, and pass the nth element of the array to the timerRepeat() method, to make the nth function the one to be called when the timer fires.
PaulS, thanks for the suggestion. Unfortunately, I have no in depth experience with C++ so could you ‘point’ me in the direction with or of an example or two?
Many thanks.