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);
}
}
bool isOpen = currentState == HIGH;
? You always sendisOpen
asHIGH
. How do you expect to update it? – jabujavibool isOpen = (currentState == HIGH);
Last weekend I start some project for fun in Parse... I would like to help you in some time. Luck! – jabujavi