|
点灯科技app可以控制,天猫精灵能绑定并且看得到设备,就是不能控制
可以帮忙修改下代码吗
[mw_shl_code=arduino,true]#define BLINKER_WIFI
#include <Blinker.h>
char auth[] = "。。。。。";
char ssid[] = "。。。。。";
char pswd[] = "。。。。。。";
#define BT_1 "lb"//后期可自行修改数据键名
BlinkerButton BT1(BT_1);
void BT1_callback(const String & state)
{
if (state == BLINKER_CMD_BUTTON_TAP){
digitalWrite(0, HIGH);
BT1.text("", "已开启");
BT1.print("on");
Blinker.delay(1500);
digitalWrite(0, LOW);
BT1.text("", "已关闭");
BT1.print("off");
}
}
void setup() {
Serial.begin(115200);
BLINKER_DEBUG.stream(Serial);
pinMode(0, OUTPUT);
digitalWrite(0, LOW);
Blinker.begin(auth, ssid, pswd);
BT1.attach(BT1_callback);
Blinker.notify("!卧室的吸顶灯已上线!");
}
void loop() {
Blinker.run();
}[/mw_shl_code]
|
|