This function works fine, as long as the if statement in the middle is commented out. If I uncomment it the code breaks. It's such a simple piece that I don't know if I'm not looking at it closely enough or if there's a bug involved. Does anyone else see what I'm missing?
The code in its entirety (sp?) is here:
http://grace.evergreen.edu/~hergab13/metro_counter.cpp(If anyone has comments/critiques on my code in general I'm listening. This style of programming is completely new to me)
Gabe
// blink the metro light at the rate specified
void metroBlink() {
if (millis() - previousMillisBlink > tempo) {
previousMillisBlink = millis(); // remember the last time we blinked the LED
// events to be triggered
counter++;
//Serial.println(counter);
/* if (counter > counterMax) {
counter = counterMin;
eventDebounceCounter = true;
}*/
// blink led at specified interval w/o delay()
digitalWrite(ledPinClock, HIGH); //blink red led on
// secondary delay
} else if (millis() - previousMillisBlink > 100) { //100 ms flash on time
//events
digitalWrite(ledPinClock, LOW); //blink red led off
}
}