Open nk25719 opened 2 months ago
Added the mute button firmware to a void function muteButton(); and calling this function in the void loop() Renamed the Button to MUTE_BUTTON_PIN
const int MUTE_BUTTON_PIN = 36; // GPIO 36 for the mute button
void setup() {
Serial.begin(115200);
pinMode(MUTE_BUTTON_PIN, INPUT_PULLUP); // Set mute button pin as input with pull-up
void loop() {
muteButton();
void muteButton() {
int currentState = digitalRead(MUTE_BUTTON_PIN);
if (lastState == LOW && currentState == HIGH) {
Serial.println("Mute Button released");
if (trackPlaying) {
myDFPlayer.pause();
trackPlaying = false;
delay(600000); // Alarm paused for 10 minutes
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Alarm Paused");
} else {
myDFPlayer.start();
trackPlaying = true;
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Alarm Resumed");
}
delay(700);
}
lastState = currentState;
}
As of 20240630, the mute button is not silencing the alarm when toggled.
Describe the bug A clear and concise description of what the bug is. Short Summary of the expected behavior: Short Summary of the buggy behavior: When an emergency alarm should go off when the mute button is pressed, but the alarm is not going off when we are pressing the mute button
To Reproduce _Steps to reproduce the behavior:
Expected behavior A clear and concise description of what you expected to happen. When the mute button is held down the emergency alarm should go off.
Screenshots If applicable, add screenshots to help explain your problem.
**Hardware description Model: Serial Number: Other:
**Test Equipment Model: Serial Number:
Additional context Add any other context about the problem here.