#include <blinker.h>
#include <mechButton.h>
mechButton aBtn(2);
mechButton bBtn(3);
blinker theLED(9);
void setup() {
aBtn.setCallback(aBtnClk);
bBtn.setCallback(bBtnClk);
}
void aBtnClk(void) {
if (!aBtn.getState()) { // We been pressed..
if (!bBtn.getState()) { // Other guy has also been pressed..
theLED.setOnOff(true); // Start blinking!
} //
} else { // We been released.
theLED.setOnOff(false); // Stop blinking!
}
}
void bBtnClk(void) {
if (!bBtn.getState()) { // We been pressed..
if (!aBtn.getState()) { // Other guy has also been pressed..
theLED.setOnOff(true); // Start blinking!
} //
} else { // We been released.
theLED.setOnOff(false); // Stop blinking!
}
}
void loop() { idle(); } // Run the magic behind the scenes. (Ticks)