Hey guys, i’m really new to this environment but really interested in this…
got a few Particle Photons to play with, one of them i have plans of using to use IFTTT and the Do button to open my gate.
I used a really straightforward code:
//The pin you want to control, in this case I'm blinking the on-board blue LED on digital pin 0
int led = D0;
//This function is called after the Photon has started
void setup(){
//We set the pin mode to output
pinMode(led, OUTPUT);
//We "Subscribe" to our IFTTT event called button so that we get events for it
Particle.subscribe("button", myHandler);
}
//The program loop, not sure if this has to be here for the program to run or not
void loop() {
}
//The function that handles the event from IFTTT
void myHandler(const char *event, const char *data){
// We'll turn the LED on
digitalWrite(led, HIGH);
// We'll leave it on for 1 second...
delay(1000);
// Then we'll turn it off...
digitalWrite(led, LOW);
}
3.3 and gnd both pinout to the relay and then D0 to signal on relay which then triggers the remote…
all of this works, however i’m having an issue where intermittently or should i say randomly D0 goes high and sends signal to relay… now of course this is all just in testing phase so it doesn’t open gate and i’ve gone as far as to completely disconnect the relay and change the code from D0 to D7 so that i can monitor the status of the digital pin by using the onboard led, yet still randomly it comes on…
any advise would be greatly appreciated guys…
much thanks.