Hello,
I'm building an alarm to send a text message when the AC-power fails. the problem I have,, When power is fails the alarm send the SMS each loop endlessly until power is restored.
I want it to send only one text-message when the power fails and happy one when power is restored. B
AC power is measured via pin 2 going incoming stream before "battery charger module"
The Alarm make a restart when it go to backup power because its a small powerdip between AC power and batterypower but when its go from AC to Battery its no dip so it dont work with "do this one time"
check = digitalRead(Powercheck); \\ Reading pin 2, if AC = Power on 5v+
if (check == LOW) {
lcd.setCursor(0,0);
lcd.print("Power Fail");
lcd.setCursor(0,1);
lcd.print("Skickar SMS");
lcd.setCursor(0,1);
lcd.print("+46706XXXXXXXX");
sms.SendSMS("+46706xxxxxxx", "Warning! Power FAIL!");
delay(3000);
}
else {
lcd.print("Power Online");
lcd.setCursor(0,1);
lcd.print("");
delay(400);
lcd.clear();
}