I am attempting to trigger a simple event on my photon via IFFFT. If a new email is received then blink all the leds 3 times. I’ve scoured the boards and found some good code examples but can’t seem to find a breakthrough. I am a complete n00b to this so apologies for stupid mistakes. Any help greatly appretiated
It doesn’t by any chance work a single time, does it?
In any case, you should take a look at your Count variable. thats a global any, and thus accessible from anywhere. In your loop, you check if it’s smaller than 3, and if so, blink and increase. That should work fine, were it not for the fact that you never reset the count. It thus then holds 3, and wont allow your IF block to run again. You could set it to 0 again, just like you reset your toggle variable. that should work.
I haven’t tested the above, but it should work. If you want to trigger your functions easily for testing, you could use this page. That way you don’t have to send an email every time.