helly
September 2, 2016, 12:46pm
1
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?
helly
September 2, 2016, 1:25pm
3
I recommend:
Using the IFTTT web interface to set up your Do button, not your phone’s app
create a Particle.function()
instead of using subscribe.
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
helly
September 2, 2016, 2:42pm
5
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
helly
September 2, 2016, 6:45pm
7
Thank you so much! I´m understanding more now.
1 Like