我将 Dragino Yun Shield 与我的 Arduino Uno 和簧片传感器一起使用。对以下代码的响应表明没有错误,但 Parse.com 上的数据并未显示它已更新。我究竟做错了什么?Bridge wifi 测试显示连接正常。
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);
}
}