#include <mechButton.h>
#include <blinker.h>
#define FAST 500
#define SLOW 1000
blinker theLED;
mechButton theBtn(2);
bool fast;
void setup() {
theBtn.setCallback(btnClick);
theLED.setPeriod(FAST);
fast = true;
theLED.setOnOff(true);
}
void btnClick(void) {
if (!theBtn.trueFalse()) {
if (fast){
theLED.setPeriod(SLOW);
} else {
theLED.setPeriod(FAST);
}
fast = !fast;
}
}
void loop() { idle(); }