Set pin to HIGH from mobile phone IFTTT too slow

Using the Particle app on my Android Phone I can set a pin to high and it happens very fast.
I tried to do the same thing with IFTTT DO button. But it ake 1 - 5 minutes before the particle turns on the LED (sets the pin to HIGH.

I just want a simple button on my phone (and an iphone). It has to be fast. IFTTT is not fast in my case. What should I try? HTTP request ? Blynk?

My Do button takes just a few seconds from when I push it to when I get a confirming Pushover message that the function was run…

what is your code like? how have you set up you Do button?

I followed this guide: https://www.hackster.io/keithmitchell/blink-a-led-on-a-photon-using-the-ifttt-button-a92c16

I recommend:

  1. Using the IFTTT web interface to set up your Do button, not your phone’s app
  2. create a Particle.function() instead of using subscribe.
  3. execute a particle function directly rather than having the particle listen for a publish

try that!

EDIT: your code may look like this instead (not compiled, not tested)



int led = D7;
int startMillis = 0;
bool ledTrigger = false;

void setup()
{
    pinMode(led, OUTPUT);
    Particle.function("Activate", myHandler);
}

void loop() 
{
  if(ledTrigger && (millis() - startMillis > 1000))
  {
    ledTrigger = false;
    digitalWrite(led, LOW);
  }
}

int myHandler(const char *data)
{
    digitalWrite(led, HIGH);
    ledTrigger = true;
    startMillis = millis();
    return 1;
}
2 Likes

I’ll have to read up. Your code gives errors that I don’t yet understand. Thanks for the help. I’ll try to get it into it today.

1 Like

I updated the code, should compile for you…

1 Like

Thank you so much! I´m understanding more now.

1 Like