// https://wokwi.com/projects/398893556031425537

// Blink LED controlled by button. CLick to activate, click to deactivate.


#include <blinker.h>
#include <mechButton.h>

blinker     ourBlinker;
mechButton  ourButton(2);

void setup() { ourButton.setCallback(buttonClk); }
  

void buttonClk(void) {

  bool  running;

  if (!ourButton.getState()) {
    running = ourBlinker.running();
    ourBlinker.setOnOff(!running);
  }
}


void loop() { idle(); }