Überlaufsicheren Timer - etwas alle x Sekunden machen

Es geht auch kompliziert:


#include <CombieTimer.h>
#include <CombiePin.h>
#include <CombieTypeMangling.h>

using namespace Combie::Millis;


Combie::Pin::OutputPin<13>      horn;
Combie::Timer::Pulsator         puls   {20_sec}; // liefert alle 20000 ms einmal true sonst false
Combie::Timer::FallingEdgeTimer toff   {10_sec}; // abfallende Flanke wird verzoegert
 
void setup(void) 
{
  horn.init();
}

void loop(void) 
{
  horn = toff = puls;
}

CombieLib.zip (975 KB)