// LED A: Blinks at a rate of 67 beats per minute (bpm).
// LED B: Blinks at a rate of 95 beats per minute (bpm).
// LED C: This LED is latched and only changes state,
// when both LED A and LED B experience a double falling edge.
#include <blinker.h>
#define MIN 60000.0
#define BLUE_LED 2
blinker greenLED(4,20,MIN/67.0);
blinker redLED(3,20,MIN/95.0);
bool blueState;
void setup(void) {
blueState = false;
pinMode(BLUE_LED,OUTPUT);
digitalWrite(BLUE_LED,blueState);
greenLED.setPercent(50);
redLED.setPercent(50);
greenLED.setOnOff(true);
redLED.setOnOff(true);
}
void loop(void) {
idle();
if (greenLED.pulseHiLow()&&redLED.pulseHiLow()) {
blueState = !blueState;
digitalWrite(BLUE_LED,blueState);
}
}