Skip to content

Commit b30ae82

Browse files
committed
Earthquake Alarm function updates
Signed-off-by: John Walicki <[email protected]>
1 parent afc38db commit b30ae82

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

WatsonIoT/src/main.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,13 +1334,18 @@ void NeoPixelBreathe() {
13341334

13351335

13361336
// Sound the Buzzer & Blink the LED
1337-
void EarthquakeAlarm() {
1337+
void EarthquakeAlarm( int AlarmLEDColor ) {
13381338
Serial.println("Earthquake Alarm!");
1339+
strip.setBrightness(255); // The breathe intensity might have the brightness low
13391340
for( int i=0;i<10;i++) {
1340-
delay(500);
1341-
NeoPixelStatus( LED_ERROR ); // Alarm - blink red
1342-
AlarmBuzzer();
1341+
if( !bStopEarthquakeAlarm ) {
1342+
delay(500);
1343+
NeoPixelStatus( AlarmLEDColor ); // Alarm - blink red or orange
1344+
AlarmBuzzer();
1345+
}
1346+
mqtt.loop(); // Process any incoming MQTT topics (which might stop the alarm)
13431347
}
1348+
strip.setBrightness( breatheintensity ); // reset the brightness to the prior intensity
13441349
digitalWrite(io, LOW); // turn off buzzer
13451350
}
13461351

0 commit comments

Comments
 (0)