This is my first attempt to create a library for Arduino.
I am trying to create a library that provides functions to implement a timer to connection and/or disconnection to be applied for example to set a flag only if a Digital Input has been HIGH for more than 200 CPU cycles, not with just a single one.
The constructor of the class receives a char to select which type of timer is it. Within the class, the constructor sets a class member function pointer to the appropriate timer function.
The problem is that if there is only one instance of the class (one timer), it works fine, but as soon as I include a second one, it starts messing…
Can anyone give me some light on what can it be going wrong??
Thanks in advance!!
Example1.ino (2.79 KB)
PLCTimer.cpp (1.3 KB)
PLCTimer.h (672 Bytes)