小爱同学不能关灯问题
解决关灯问题,补充语句if (colorW > 0) colorW = 0;void miotPowerState(const String & state)
{
BLINKER_LOG("need set power state: ", state);
if (state == BLINKER_CMD_ON) {
digitalWrite(LED_BUILTIN, HIGH);
BlinkerMIOT.powerState("on");
BlinkerMIOT.print();
wsState = true;
if (colorW == 0) colorW = 255;
}
else if (state == BLINKER_CMD_OFF) {
digitalWrite(LED_BUILTIN, LOW);
BlinkerMIOT.powerState("off");
BlinkerMIOT.print();
wsState = false;
if (colorW > 0) colorW = 0; //定义colorW = 0
}
pixelShow();
}
页:
[1]