diff --git a/firmware/firmware.ino b/firmware/firmware.ino index 36b97b1..1732972 100644 --- a/firmware/firmware.ino +++ b/firmware/firmware.ino @@ -120,6 +120,9 @@ void greenLEDOff() { digitalWrite(GREEN_LED_PIN, LED_OFF); } void redLEDOn() { digitalWrite(RED_LED_PIN, LED_ON); } void redLEDOff() { digitalWrite(RED_LED_PIN, LED_OFF); } +void relayOn() { digitalWrite(RELAY_PIN, RELAY_CLOSED); } +void relayOff() { digitalWrite(RELAY_PIN, RELAY_OPEN); } + void processLockState() { switch (lockState) { @@ -127,7 +130,7 @@ void processLockState() greenLEDOff(); redLEDOn(); - digitalWrite(RELAY_PIN, RELAY_OPEN); + relayOff(); break; case LOCK_PREARM: if (!greenButton() && !redButton()) { @@ -141,7 +144,7 @@ void processLockState() greenLEDOff(); redLEDOn(); - digitalWrite(RELAY_PIN, RELAY_OPEN); + relayOff(); if (redButton()) { if (LOGGING) Serial.println("[INFO] Unarming interlock."); @@ -164,7 +167,7 @@ void processLockState() greenLEDOn(); redLEDOff(); - digitalWrite(RELAY_PIN, RELAY_CLOSED); + relayOn(); if (redButton()) { if (LOGGING) Serial.println("[INFO] Off button pressed.");