What is the proper way for a sketch to redefine a library's defaults?
I am making a library for taking pin inputs and applying multiple modifications before returning a pseudo pin state. An example would be repeating a button pressed event on a timer while the actual button is just being held down.
In different sketches I would like to be able to declare a different default repeat rate for all instances of the class. So far I can only see 2 ways to go.
- Modify the constructor in the library header to suit before compiling
- Define static variables for the constructor to read and a static function to initialize them
Option 1 is simpler but means a different version of the library for each sketch that needs different defaults. Option 2 means undefined behaviour from the constructor until the static function is called to init the defaults.
Am I missing a better option 3?