Created
June 17, 2023 03:07
-
-
Save seanboe/db9fdb907acdd44628058c94613f3129 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (batt1On && batt1V < BATT_EMPTY && batt2Installed && !batt2On) { | |
ISR_Override = true; | |
digitalWrite(BATT_2_CTL, HIGH); | |
batt2On = true; | |
prevSwitchTime = micros(); | |
Serial.println("Switched to batt 2!"); | |
buffer += "Switching to batt 2"; | |
if (batt2V > BATT_EMPTY) { | |
digitalWrite(BATT_1_CTL, LOW); | |
batt1On = false; | |
prevSwitchTime = micros(); | |
buzzerTimer.set(BUZZ_INTERVAL_SLOW, 4); | |
} | |
else { | |
buzzerTimer.set(BUZZ_INTERVAL_RAPID, 20); | |
} | |
ISR_Override = false; | |
} | |
if (batt2On && batt2V < BATT_EMPTY && batt1Installed && !batt1On) { | |
ISR_Override = true; | |
digitalWrite(BATT_1_CTL, HIGH); | |
batt1On = true; | |
prevSwitchTime = micros(); | |
Serial.println("Switched to batt 1!"); | |
buffer += "Switching to batt 1"; | |
if (batt1V > BATT_EMPTY) { | |
digitalWrite(BATT_2_CTL, LOW); | |
batt2On = false; | |
prevSwitchTime = micros(); | |
buzzerTimer.set(BUZZ_INTERVAL_SLOW, 4); | |
} | |
else { | |
buzzerTimer.set(BUZZ_INTERVAL_RAPID, 20); | |
} | |
ISR_Override = false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment