diff --git a/debouncing.cpp b/debouncing.cpp index 97b5fad9..b08ca7c8 100644 --- a/debouncing.cpp +++ b/debouncing.cpp @@ -6,10 +6,6 @@ boolean key_was_pressed (byte keyState) { return (! key_was_not_pressed(keyState)); - - - - } boolean key_was_not_pressed (byte keyState) { @@ -18,29 +14,22 @@ boolean key_was_not_pressed (byte keyState) { } else { return true; } - - - - - - } boolean key_is_pressed (byte keyState) { - if ( keyState & B00000001 && keyState & B00000010 ) { - return true; } else { return false; } } + 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_not_pressed(keyState)) { return true; } else { return false;