Implement stateChanged variable if BOUNCE_LOCK-OUT

This commit is contained in:
thomasfredericks
2014-01-11 13:32:55 -05:00
parent 13857a8529
commit 2eda74ad92
+3 -3
View File
@@ -38,17 +38,17 @@ bool Bounce::update()
{
#ifdef BOUNCE_LOCK-OUT
stateChanged = false;
// Ignore everything if we are locked out
if (millis() - previous_millis >= interval_millis) {
uint8_t currentState = digitalRead(pin);
if (debouncedState != currentState ) {
previous_millis = millis();
debouncedState = currentState;
return 1;
stateChanged = true;
}
}
return 0;
return stateChanged;
#else
// Lire l'etat de l'interrupteur dans une variable temporaire.