I used #include “application.h” and that didn’t fix my problem. My code was largely copied from the example for an IFTTT action. I am pretty new to Particle and I haven’t been able to find a solution to this.
Particle.function("ledtest", "lightup");
#include "application.h"
// USAGE
int ledon(String command);
int led = D0;
void setup()
{
// register the Particle function
Particle.function("lightup", ledon);
pinMode(led, OUTPUT);
}
void loop()
{
// this loops forever, doing nothing
}
// this function automagically shows up in IFTTT
int ledon(String command)
{
// look for the matching argument "coffee" <-- max of 64 characters long
if(command == "light")
{
//things you want it to do
digitalWrite(led, HIGH);
//Returns the value "1" if it was successful
return 1;
}
else return -1;
}