小白求助!怎么自锁开关状态
就是比如我打开开关以后,不能再执行打开命令,小爱回复该设备已打开,程序如下:bool oState = false;
int counter = 0;
void miotPowerState (const String & state)
{
BLINKER_LOG ("need set power state: ", state);
if (state == BLINKER_CMD_ON) {
digitalWrite(0, HIGH);
BlinkerMIOT.powerState("on");
BlinkerMIOT.print();
oState = true;
}
else if (state == BLINKER_CMD_OFF) {
digitalWrite(0,LOW);
BlinkerMIOT.powerState("off");
BlinkerMIOT.print();
oState = false;
}
}
页:
[1]