diff --git a/debouncing.cpp b/debouncing.cpp index b08ca7c8..79c76087 100644 --- a/debouncing.cpp +++ b/debouncing.cpp @@ -5,14 +5,10 @@ boolean key_was_pressed (byte keyState) { - return (! key_was_not_pressed(keyState)); -} - -boolean key_was_not_pressed (byte keyState) { if ( keyState & B00001000 || keyState & B00000100) { - return false; - } else { return true; + } else { + return false; } } @@ -24,12 +20,8 @@ boolean key_is_pressed (byte keyState) { } } -boolean key_is_not_pressed (byte keyState) { - return !key_is_pressed(keyState); -} - boolean key_toggled_on(byte keyState) { - if (key_is_pressed(keyState) && key_was_not_pressed(keyState)) { + if (key_is_pressed(keyState) && ! key_was_pressed(keyState)) { return true; } else { return false; @@ -38,7 +30,7 @@ boolean key_toggled_on(byte keyState) { boolean key_toggled_off(byte keyState) { - if (key_was_pressed(keyState) && key_is_not_pressed(keyState)) { + if (key_was_pressed(keyState) && ! key_is_pressed(keyState)) { return true; } else { return false; diff --git a/debouncing.h b/debouncing.h index d31f4d15..c3d1922d 100644 --- a/debouncing.h +++ b/debouncing.h @@ -3,8 +3,6 @@ boolean key_was_pressed (byte keyState); -boolean key_was_not_pressed (byte keyState); boolean key_is_pressed (byte keyState); -boolean key_is_not_pressed (byte keyState); boolean key_toggled_on(byte keyState); boolean key_toggled_off(byte keyState);