From 19a1c177c68db1afee2bfefd1da16961ba156c6b Mon Sep 17 00:00:00 2001 From: Philipp Matthias Schaefer Date: Sun, 2 Feb 2020 20:53:07 +0100 Subject: [PATCH] Move update of space_status_b4 into own function --- arduino/door_status.ino | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/arduino/door_status.ino b/arduino/door_status.ino index 461ee11..9cbf3b8 100644 --- a/arduino/door_status.ino +++ b/arduino/door_status.ino @@ -39,11 +39,7 @@ void update_space_status() { } } -void loop(){ - print_status(); - - update_space_status(); - +void update_space_status_b4() { // status check if we can switch the status. // low pass prevents waggling a bit if (space_status >= THRESHOLD-3) { @@ -53,6 +49,14 @@ void loop(){ // open space_status_b4 = 0; } +} + +void loop(){ + print_status(); + + update_space_status(); + + update_space_status_b4(); delay(DELAY_TIME);