Arduino refactoring #4

Open
fiveop wants to merge 28 commits from fiveop/arduino_refactoring into master
Showing only changes of commit da152247ac - Show all commits

View file

@ -31,9 +31,7 @@ void print_status() {
Serial.println(space_status); Serial.println(space_status);
} }
void loop(){ void update_space_status() {
print_status();
int pin_status = 0; int pin_status = 0;
pin_status = digitalRead(REED_SWITCH_INPUT_PIN); pin_status = digitalRead(REED_SWITCH_INPUT_PIN);
@ -48,6 +46,12 @@ void loop(){
space_status += 1; space_status += 1;
} }
} }
}
void loop(){
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