Reputation: 979
I'm using a Dragino Yun Shield with my Arduino Uno and a reed sensor. The response to the code below indicates no errors, but yet the data on Parse.com does not show that it is updated. What am I doing wrong? The Bridge wifi test says it's connected just fine.
void loop() {
currentState = digitalRead(7);
if(currentState != prevState){
prevState = currentState;
Console.println("Pushing to parse!");
ParseObjectUpdate update;
update.setClassName("DoorState");
update.setObjectId("##########");
bool isOpen = currentState == HIGH;
update.add("isOpen", isOpen);
ParseResponse response = update.send();
if (!response.getErrorCode()) {
Console.println("Object saved success!");
} else {
Console.println("Error");
int err = response.getErrorCode();
Console.println(err);
}
response.close();
Console.print("Pushed: "); Console.println(isOpen);
}
}
Upvotes: 0
Views: 43
Reputation: 223
Copied from a similar thread that I answered (Arduino yun to parse.com):
You are probably being rate limited by Parse. The code executed in loop() is executed as quickly as the micro controller can execute it - which is very fast. As a result, you are trying to write to Parse many many more times than once a second. Try putting a call to delay() after parseFunc(24). Something like:
parseFunc(24); delay(1000); //delay is in milliseconds
Let me know if it works!
Upvotes: 0