Move update of space_status_b4 into own function

This commit is contained in:
Philipp Matthias Schaefer 2020-02-02 20:53:07 +01:00
parent b14055bcfa
commit 19a1c177c6

View file

@ -39,11 +39,7 @@ void update_space_status() {
} }
} }
void loop(){ void update_space_status_b4() {
print_status();
update_space_status();
// status check if we can switch the status. // status check if we can switch the status.
// low pass prevents waggling a bit // low pass prevents waggling a bit
if (space_status >= THRESHOLD-3) { if (space_status >= THRESHOLD-3) {
@ -53,6 +49,14 @@ void loop(){
// open // open
space_status_b4 = 0; space_status_b4 = 0;
} }
}
void loop(){
print_status();
update_space_status();
update_space_status_b4();
delay(DELAY_TIME); delay(DELAY_TIME);