hi all,
This is my first post here so please bear with me!
I'm trying to send a pulse trigger to the "IFTTT" sms notification app from my fire alarm, via my arduino uno & esp8266. Basically, when an alarm is triggered, it sends an input to my arduino, which sends input to the esp8266, which triggers the "IFTTT". The problem is that as long as the alarm is activated i get a constant stream of commands to the "IFTTT" resulting in a constant stream of sms's to me!
Is there a way of writing code to have the alarm trigger a timer in the arduino that will only last a second, then drop, or even send a one second pulse every 5 mins until the alarm is reset?
Any help would be really appreciated.
thanks,
kelladam
Is there a way of writing code to have the alarm trigger a timer in the arduino that will only last a second, then drop, or even send a one second pulse every 5 mins until the alarm is reset?
Yes, of course.
Post your current code here and read Using millis() for timing. A beginners guide, Several things at the same time and look at the BlinkWithoutDelay example in the IDE.
thanks for your reply 
this is my alarm code; (i'm using the "redled" as the output to the esp8266)
int redled fire = 9;
int greenled ok = 8;
int smokeA0 kitchen = A5;
// Your threshold value
int sensorThres = 150;
void setup() {
pinMode(redLed, OUTPUT);
pinMode(greenLed, OUTPUT);
pinMode(buzzer, OUTPUT);
pinMode(smokeA0, INPUT);
Serial.begin(9600);
}
void loop() {
int analogSensor = analogRead(smokeA0);
Serial.print("Pin A0: ");
Serial.println(analogSensor);
// Checks if it has reached the threshold value
if (analogSensor > sensorThres)
{
digitalWrite(redLed, HIGH);
digitalWrite(greenLed, LOW);
tone(buzzer, 1000, 200);
}
else
{
digitalWrite(redLed, LOW);
digitalWrite(greenLed, HIGH);
noTone(buzzer);
}
delay(100);
The code that you posted is incomplete. Please check it and put code tags round it to make it easier to copy to an editor. Don't know what code tags are ? then read read this before posting a programming question which is one of the sticky posts at the top of the forum page.
int redled fire = 9;
int greenled ok = 8;
int smokeA0 kitchen = A5;
// Your threshold value
int sensorThres = 150;
void setup() {
pinMode(redLed, OUTPUT);
pinMode(greenLed, OUTPUT);
pinMode(buzzer, OUTPUT);
pinMode(smokeA0, INPUT);
Serial.begin(9600);
}
void loop() {
int analogSensor = analogRead(smokeA0);
Serial.print("Pin A0: ");
Serial.println(analogSensor);
// Checks if it has reached the threshold value
if (analogSensor > sensorThres)
{
digitalWrite(redLed, HIGH);
digitalWrite(greenLed, LOW);
tone(buzzer, 1000, 200);
}
else
{
digitalWrite(redLed, LOW);
digitalWrite(greenLed, HIGH);
noTone(buzzer);
}
delay(100);
The code is still incomplete