#include <mechButton.h>

mechButton    countBtn(3);
mechButton    blinkBtn(2);
int           count;
int           blinkCount;

void setup() {
  
  count = 0;
  blinkCount = 0;
  countBtn.setCallback(countClk);
  blinkBtn.setCallback(blinkClk);
}

void countClk(void) { if (!countBtn.trueFalse()) count++; }

void blinkClk(void) { 
  
  if (!blinkBtn.trueFalse()) {
    blinkCount = count;
    count = 0;
  }
} 
  
void loop() { 
  
  idle();
  if (blinkCount) {
    digitalWrite(13,HIGH);
    sleep(100);
    digitalWrite(13,LOW);
    sleep(300);
    blinkCount--;
  }
}