diff --git a/src/main.rs b/src/main.rs index dae6de9..231b026 100644 --- a/src/main.rs +++ b/src/main.rs @@ -80,7 +80,13 @@ fn main() -> ! { // This debouncing sucks ass and isn't good - doesn't matter, just for testing switch_count = match switch.is_low() { true => 1.0, - false => switch_count - 0.2, + false => { + if switch_count > 0.0 { + switch_count - 0.2 + } else { + 0.0 + } + }, }; let val;