Examples of basic recipes

Hi @Moors7,
I tried to follow the instructions with only one observation. I think you need to put the function before the setup, and the return for the function (no?). This is the code (by the way ¿how did you show the code in a shaded cool area?):

/********************/
*#define ledPin D7  // ignore the asterisk in the beginning
bool toggle = false;

int ledToggle(String command);

void setup() {
    pinMode(ledPin, OUTPUT);
    Particle.function("ledPin", ledToggle);
}

void loop() {
    if(toggle == true){
        digitalWrite(ledPin, HIGH);
        delay(5000);
        digitalWrite(ledPin, LOW);
        toggle = false;
    }
}

int ledToggle(String command){
    toggle = true;
}
/***********************************/

But when I try to connect so that each time a take a picture (just to have a real example) the photon shows the led on D7 blink once. The IFTTT platform still shows me the same functions:

Could you see what I am doing wrong? I wasn’t able to change this even when I reconnect to the channel of particle and restart the photon several times just in case.

Thank you very much,

Brayan


I’ve edited your post to properly format the code. Please check out this post, so you know how to do this yourself in the future. Thanks in advance! ~@Moors7