diff --git a/arduino/door_status.ino b/arduino/door_status.ino index be4d001..7a21a3d 100644 --- a/arduino/door_status.ino +++ b/arduino/door_status.ino @@ -8,6 +8,18 @@ const int RED_LED_OUTPUT_PIN = 12; const int YELLOW_LED_OUTPUT_PIN = 11; const int GREEN_LED_OUTPUT_PIN = 10; +const int DELAY_TIME = 1000; + +const int MAX_COUNTER = 20; +const int LOWER_THRESHOLD = 4; +const int UPPER_THRESHOLD = MAX_COUNTER - LOWER_THRESHOLD; + +const int CLOSED_DOOR = 1; +const int OPEN_DOOR = 0; + +int measured_state_counter = MAX_COUNTER / 2; +int published_state = OPEN_DOOR; + void setup(){ Serial.begin(9600); @@ -18,16 +30,6 @@ void setup(){ pinMode(GREEN_LED_OUTPUT_PIN, OUTPUT); } -const int DELAY_TIME = 1000; -const int MAX_COUNTER = 20; -const int LOWER_THRESHOLD = 4; -const int UPPER_THRESHOLD = MAX_COUNTER - LOWER_THRESHOLD; -const int CLOSED_DOOR = 1; -const int OPEN_DOOR = 0; - -int measured_state_counter = MAX_COUNTER / 2; -int published_state = OPEN_DOOR; - void print_status() { Serial.print(" "); Serial.print(published_state);