Hi, im having troubles working with curl on terminal (mac). I have this following code flashed on to the photon device:
int led = D7;
void setup() {
pinMode(led, OUTPUT);
digitalWrite(led, LOW);
Particle.function("toggle", toggleLights);
}
int toggleLights(String command) {
if (command == "on") {
digitalWrite(led, HIGH);
return 1;
}
else return 0;
}
void loop() {
}
and when I run
curl https://api.particle.io/v1/devices/[device id]/toggle \
-d access_token=[access token] \
-d "args=on”
it gives me this:
"id": [device id],
"last_app": "",
"connected": true,
"return_value": 0
when I want the return value to be 1 and make the built-in LED blink.
What am I doing wrong here?
Thank you in advance.