/* Devil Elec - µC.net IDE 1.8.19 avr-gcc: 7.5.0 & C++17 Arduino Mega 2560 22.05.2026 */ #include template constexpr size_t arrayCount(const T (&)[N]) { return N; } template class SimpleTimer { private: unsigned long lastMillis {0xEFFFFFFF}; // provoziert eine sofortige Auslösung nach uC Reset unsigned long duration {0}; Callback callback; public: SimpleTimer (unsigned long d, Callback cb): duration(d), callback(cb) {} void update() { const unsigned long ms {millis()}; if (ms - lastMillis >= duration) { lastMillis = ms; callback(); // direkt, ohne std::function } } void set (const unsigned long d) { duration = (0