|
本帖最后由 363759554 于 2020-3-21 22:28 编辑
平台:blinker控制方式:app、siri、小爱 (某人让我放弃,抱着不抛弃不放弃的精神摸索出来了)
硬件:esp8266-01 、2N三极管、红外二极管
控制电器:1、格力空调 2、长虹电视 3、不知道品牌的灯具
一、先来看看遥控的全家福
遥控器
是不是很眼熟从左到右 长虹电视遥控>>灯具遥控>>空调遥控
二、app按钮布局 (按钮能再缩小,布局就可以调得好看了)
APP截图
三、巧妙的使用小爱训练可以让很多指令转化成你想控制的设备指令
小爱训练
四、下面是源码,首次接触这个,不严谨的地方勿喷
[mw_shl_code=arduino,true]#define BLINKER_PRINT Serial
#define BLINKER_MIOT_LIGHT
#define BLINKER_WIFI
#define BLINKER_ESP_SMARTCONFIG
#include <Arduino.h>
#include <IRremoteESP8266.h>
#include <ir_Kelvinator.h>
#include <IRsend.h>
#include <Blinker.h>
char auth[] = "xxxxxxxxxxxxx";
//暂存温度、风速、模式数据
int nowtemp = 26;
int num_mode = 1;
int nowfan = 5;
bool kt_powr = false;
bool kt_fan = false;
//--------------------------------------------
uint8_t colorR, colorG, colorB,colorT, colorW;
bool wsState;
const uint16_t kIrLed = 2; //ESP8266的D2脚针
IRsend irsend(kIrLed);
IRKelvinatorAC ac(kIrLed);
int tmp;
int num_sw_fd = 1;
bool oState = false;
bool yd = false;
uint8_t wsMode = 9999;
// 灯遥控组件对象
BlinkerButton btn_power("light-pwr"); //开关
BlinkerButton btn_yd("light-yd"); //夜灯
BlinkerButton sw_up("light-sw-up"); //色温+
BlinkerButton sw_down("light-sw-down"); //色温-
BlinkerButton sw_fd("light-fd"); //分段
BlinkerButton ld_up("light-ld-up"); //亮度+
BlinkerButton ld_down("light-ld-down"); //亮度-
BlinkerNumber num_fd("light-num-fd"); //分段数显
// 空调遥控组件对象
BlinkerNumber NUM1("kt-fan");
BlinkerNumber NUM2("kt-settemp");
BlinkerButton Kelvinator_power("kt-pwr");
BlinkerButton Kelvinator_setmode("kt-mode");
BlinkerButton Kelvinator_Light("kt-deng");
BlinkerButton Kelvinator_sxfan("kt-sx");
BlinkerSlider Slider1("kt-ran-wen");
BlinkerSlider Slider2("kt-ran-fan");
// 电视遥控组件对象
BlinkerButton ds_power("ds-pwr");
BlinkerButton ds_ylup("ds-ylup");
BlinkerButton ds_yldown("ds-yldown");
BlinkerButton ds_up("ds-up");
BlinkerButton ds_down("ds-down");
BlinkerButton ds_left("ds-left");
BlinkerButton ds_rigt("ds-rigt");
BlinkerButton ds_ok("ds-ok");
BlinkerButton ds_back("ds-back");
BlinkerButton ds_movie("ds-movie");
BlinkerButton ds_home("ds-home");
BlinkerButton ds_signal("ds-signal");
void sentNEC(unsigned int code){
BLINKER_LOG("NEC: ",code);
irsend.sendNEC(code); //0x1FE609F
}
void sentNecRaw(unsigned int code){ //灯按住不放执行编码
uint16_t rawData[3] = {8950,2250, 550};
for(int i=1;i<10;i++){
if(i == 1){sentNEC(code);}else{ irsend.sendRaw(rawData, 3, 38);delay(50);}
}
}
//=======================================灯相关========================================
//开关
void btn_power_callback(const String & state)
{
BLINKER_LOG("btn_power state: ", state);
if (state == BLINKER_CMD_ON) {
sentNEC(0x1FE807F);
btn_power.color("#00FF00");
btn_power.text("开");
btn_power.print("on");
BlinkerMIOT.powerState("on"); //反馈电源状态
oState = true;
}
else if (state == BLINKER_CMD_OFF) {
sentNEC(0x1FE807F);
btn_power.color("#FF0000");
btn_power.text("关");
btn_power.print("off");
BlinkerMIOT.powerState("off"); //反馈电源状态
oState = false;
}
BlinkerMIOT.print(); //将以上属性发送出去, 务必最后调用该函数
}
//色温+
void sw_up_callback(const String &state)
{
sentNecRaw(0x1FE40BF);
Blinker.print("sw_up_callback state: ", state);
}
//色温-
void sw_down_callback(const String &state)
{
sentNecRaw(0x1FEC03F);
Blinker.print("sw_down_callback state: ", state);
}
//亮度+
void ld_up_callback(const String &state)
{
sentNecRaw(0x1FE48B7);
Blinker.print("ld_up_callback state: ", state);
}
//亮度-
void ld_down_callback(const String &state)
{
sentNecRaw(0x1FE7887);
Blinker.print("ld_down_callback state: ", state);
}
//分段
void sw_fd_callback(const String &state)
{
Blinker.print("sw_fd_callback state: ", state);
fd_fun();
}
//夜灯
void btn_yd_callback(const String & state)
{
BLINKER_LOG("yd_callback state: ", state);
if (state == BLINKER_CMD_ON) {
sentNEC(0x1FEA05F);
btn_yd.color("#00FF00");
btn_yd.text("夜灯开");
btn_yd.print("on");
yd = true;
}
else if (state == BLINKER_CMD_OFF) {
sentNecRaw(0x1FE48B7);
btn_yd.color("#999999");
btn_yd.text("夜灯关");
btn_yd.print("off");
yd = false;
}
}
//心跳包
void heartbeat()
{
//灯
switch (num_sw_fd)
{
case 1:
sw_fd.color("#7CFC00");
sw_fd.text("色段一");
break;
case 2:
sw_fd.color("#8080FF");
sw_fd.text("色段二");
break;
case 3:
sw_fd.color("#FF0000");
sw_fd.text("色段三");
break;
}
sw_fd.print();
num_fd.print(num_sw_fd);
//空调
switch (num_mode)
{
case 1:
Kelvinator_setmode.icon("far fa-recycle");
Kelvinator_setmode.color("#7FFFD4");
Kelvinator_setmode.text("自动");
break;
case 2:
Kelvinator_setmode.icon("fas fa-snowflake");
Kelvinator_setmode.color("#1E90FF");
Kelvinator_setmode.text("制冷");
break;
case 3:
Kelvinator_setmode.icon("fas fa-tint");
Kelvinator_setmode.color("#7CFC00");
Kelvinator_setmode.text("除湿");
break;
case 4:
Kelvinator_setmode.icon("fab fa-first-order-alt");
Kelvinator_setmode.color("#E0FFFF");
Kelvinator_setmode.text("送风");
break;
case 5:
Kelvinator_setmode.icon("fas fa-sun");
Kelvinator_setmode.color("#FF0000");
Kelvinator_setmode.text("制热");
break;
}
Kelvinator_setmode.print();
NUM2.print(nowtemp);
}
//灯控制开关
void miotPowerState(const String & state)
{
BLINKER_LOG("need set power state: ", state);
if (state == BLINKER_CMD_ON) {
sentNEC(0x1FE807F);
BlinkerMIOT.powerState("on");
oState = true;
}
else if (state == BLINKER_CMD_OFF) {
sentNEC(0x1FE807F);
BlinkerMIOT.powerState("off");
oState = false;
}
BlinkerMIOT.print();
}
//亮度范围为1-100
void miotBright(const String & bright)
{
BLINKER_LOG("need set brightness: ", bright);
BLINKER_LOG("now set brightness: ", colorW);
tmp = bright.toInt();
if(tmp == 21){ //调亮
colorW = colorW + tmp;
sentNecRaw(0x1FE48B7);
}else if(tmp == 1){ //调暗
colorW = colorW - tmp;
sentNecRaw(0x1FE7887);
}
BlinkerMIOT.brightness(colorW);
BlinkerMIOT.print();
}
//色温范围为 暖1000-冷10000 + 空调控制
void miotColoTemp(int32_t colorTemp)
{
BLINKER_LOG("need set colorTemperature: ", colorTemp);
switch (colorTemp){
case 1000 : //调暖
colorT = colorT - colorTemp;
sentNecRaw(0x1FE40BF);
break;
case 2800 : //调冷
colorT = colorT + colorTemp;
sentNecRaw(0x1FEC03F);
break;
//......
//其他控制可以写到这里
default :
break;
}
BlinkerMIOT.colorTemp(colorT);
BlinkerMIOT.print();
}
//夜灯模式-函数
void deng_yd()
{
if (!yd) {
sentNEC(0x1FEA05F);
btn_yd.color("#00FF00");
btn_yd.text("夜灯开");
btn_yd.print("on");
yd = true;
}
else if (yd) {
sentNecRaw(0x1FE48B7);
btn_yd.color("#999999");
btn_yd.text("夜灯关");
btn_yd.print("off");
yd = false;
}
}
//色温分段函数
void fd_fun(){
num_sw_fd++;
if (num_sw_fd >= 4) { num_sw_fd = 1; }
sentNEC(0x1FE609F);
switch (num_sw_fd)
{
case 1:
sw_fd.color("#1E90FF");
sw_fd.text("色段一");
break;
case 2:
sw_fd.color("#8080FF");
sw_fd.text("色段二");
break;
case 3:
sw_fd.color("#FF0000");
sw_fd.text("色段三");
break;
}
sw_fd.print();
num_fd.print(num_sw_fd);
}
//自定义查询
void miotQuery(int32_t queryCode)
{
BLINKER_LOG("MIOT Query codes: ", queryCode);
switch (queryCode)
{
case BLINKER_CMD_QUERY_ALL_NUMBER :
BLINKER_LOG("MIOT Query All");
BlinkerMIOT.powerState(wsState ? "on" : "off");
BlinkerMIOT.color(0);
BlinkerMIOT.mode(0);
BlinkerMIOT.colorTemp(1000);
BlinkerMIOT.brightness(1);
BlinkerMIOT.print();
break;
case BLINKER_CMD_QUERY_POWERSTATE_NUMBER :
BLINKER_LOG("MIOT Query Power State");
BlinkerMIOT.powerState(wsState ? "on" : "off");
BlinkerMIOT.print();
break;
case BLINKER_CMD_QUERY_COLOR_NUMBER :
BLINKER_LOG("MIOT Query Color");
BlinkerMIOT.color(0);
BlinkerMIOT.print();
break;
case BLINKER_CMD_QUERY_MODE_NUMBER :
BLINKER_LOG("MIOT Query Mode");
BlinkerMIOT.mode(0);
BlinkerMIOT.print();
break;
case BLINKER_CMD_QUERY_COLORTEMP_NUMBER :
BLINKER_LOG("MIOT Query ColorTemperature");
BlinkerMIOT.colorTemp(1000);
BlinkerMIOT.print();
break;
case BLINKER_CMD_QUERY_BRIGHTNESS_NUMBER :
BLINKER_LOG("MIOT Query Brightness");
BlinkerMIOT.brightness(1);
BlinkerMIOT.print();
break;
default :
BlinkerMIOT.powerState(wsState ? "on" : "off");
BlinkerMIOT.color(0);
BlinkerMIOT.mode(0);
BlinkerMIOT.colorTemp(1000);
BlinkerMIOT.brightness(1);
BlinkerMIOT.print();
break;
}
}
//=======================================空调相关========================================
void printState() {
Serial.println("Kelvinator A/C remote is in the following state:");
Serial.printf(" %s\n", ac.toString().c_str());
unsigned char* ir_code = ac.getRaw();
Serial.print("IR Code: 0x");
for (uint8_t i = 0; i < kKelvinatorStateLength; i++)
Serial.printf("%02X", ir_code);
Serial.println();
}
//空调控制
void kt_miotMode(uint8_t mode)
{
Blinker.print("need set mode: ", mode);
wsMode = mode;
BlinkerMIOT.mode(mode);
BlinkerMIOT.print();
if (mode == BLINKER_CMD_MIOT_DAY) { //0 日光模式
//空调开关
kt_power();
} else if (mode == BLINKER_CMD_MIOT_NIGHT) { //1 夜光模式
//空调模式
kt_mode();
} else if (mode == BLINKER_CMD_MIOT_COLOR) { //2 彩光模式
//空调上下风
kt_sxfan();
} else if (mode == BLINKER_CMD_MIOT_WARMTH) { //3 温馨模式
//空调风速+1
kt_fs_up();
} else if (mode == BLINKER_CMD_MIOT_TV) { //4 电视模式
//空调风速-1
kt_fs_down();
} else if (mode == BLINKER_CMD_MIOT_READING) {//5 阅读模式
//空调温度+2
kt_wd_up();
} else if (mode == BLINKER_CMD_MIOT_COMPUTER) {//6 电脑模式
//空调温度-2
kt_wd_down();
}
}
//空调开关-函数
void kt_power()
{
if (!kt_powr)
{
ac.on();
ac.setFan(5);
ac.setMode(kKelvinatorCool);
ac.setTemp(26);
ac.setLight(true);
ac.send();
Kelvinator_power.icon("fal fa-power-off");
Kelvinator_power.color("#00FF00");
Kelvinator_power.text("开");
Kelvinator_power.print("on");
kt_powr = true;
}
else
{
ac.off();
ac.setLight(true);
ac.send();
Kelvinator_power.icon("fal fa-power-off");
Kelvinator_power.color("#FF0000");
Kelvinator_power.text("关");
Kelvinator_power.print("off");
kt_powr = false;
}
}
//空调模式-函数
void kt_mode()
{
num_mode++;
if (num_mode >= 6) { num_mode = 1; }
switch (num_mode)
{
case 1:
ac.setMode(kKelvinatorAuto);
Kelvinator_setmode.icon("fal fa-recycle");
Kelvinator_setmode.color("#008000");
Kelvinator_setmode.text("自动");
break;
case 2:
ac.setMode(kKelvinatorCool);
Kelvinator_setmode.icon("fal fa-snowflake");
Kelvinator_setmode.color("#1E90FF");
Kelvinator_setmode.text("制冷");
break;
case 3:
ac.setMode(kKelvinatorDry);
Kelvinator_setmode.icon("fal fa-tint-slash");
Kelvinator_setmode.color("#87CEFA");
Kelvinator_setmode.text("除湿");
break;
case 4:
ac.setMode(kKelvinatorFan);
Kelvinator_setmode.icon("fab fa-first-order-alt");
Kelvinator_setmode.color("#2E8B57");
Kelvinator_setmode.text("送风");
break;
case 5:
ac.setMode(kKelvinatorHeat);
Kelvinator_setmode.icon("fas fa-sun");
Kelvinator_setmode.color("#FF0000");
Kelvinator_setmode.text("制热");
break;
}
Kelvinator_setmode.print();
ac.send();
}
//空调上下风-函数
void kt_sxfan()
{
if (!kt_fan)
{
ac.setSwingVertical(true);
ac.send();
Kelvinator_sxfan.color("#00FF00");
Kelvinator_sxfan.text("上下风");
Kelvinator_sxfan.print("on");
kt_fan = true;
}
else
{
ac.setSwingVertical(false);
ac.send();
Kelvinator_sxfan.color("#999999");
Kelvinator_sxfan.text("上下风");
Kelvinator_sxfan.print("off");
kt_fan = false;
}
}
//空调风速+ 函数 每次调高1挡
void kt_fs_up()
{
nowfan++;
NUM1.print(nowfan);
ac.setFan(nowfan);
ac.setXFan(true);
ac.send();
}
//空调风速- 函数 每次调低1挡
void kt_fs_down()
{
nowfan--;
NUM1.print(nowfan);
ac.setFan(nowfan);
ac.setXFan(true);
ac.send();
}
//空调温度+ 函数 每次调高2度
void kt_wd_up()
{
nowtemp = nowtemp + 2;
if(nowtemp >= 30){nowtemp = 30;}
NUM2.print(nowtemp);
ac.setTemp(nowtemp);
ac.send();
}
//空调温度- 函数 每次调低2度
void kt_wd_down()
{
nowtemp = nowtemp - 2;
if(nowtemp <= 16){nowtemp = 16;}
NUM2.print(nowtemp);
ac.setTemp(nowtemp);
ac.send();
}
//空调电源开关
void Kelvinator_power_callback(const String &state)
{
BLINKER_LOG("get button state: ", state);
if (state == BLINKER_CMD_ON)
{
ac.on();
ac.setFan(5);
ac.setMode(kKelvinatorCool);
ac.setTemp(26);
ac.setLight(true);
ac.send();
Kelvinator_power.icon("fal fa-power-off");
Kelvinator_power.color("#00FF00");
Kelvinator_power.text("开");
Kelvinator_power.print("on");
kt_powr = true;
}
else if (state == BLINKER_CMD_OFF)
{
ac.off();
ac.setLight(true);
ac.send();
Kelvinator_power.icon("fal fa-power-off");
Kelvinator_power.color("#FF0000");
Kelvinator_power.text("关");
Kelvinator_power.print("off");
kt_powr = false;
}
}
//空调灯光
void Kelvinator_Light_callback(const String &state)
{
if (state == BLINKER_CMD_ON)
{
ac.setLight(true);
ac.send();
Kelvinator_Light.color("#00FF00");
Kelvinator_Light.text("灯光开");
Kelvinator_Light.print("on");
}
else if (state == BLINKER_CMD_OFF)
{
ac.setLight(false);
ac.send();
Kelvinator_Light.color("#999999");
Kelvinator_Light.text("灯光关");
Kelvinator_Light.print("off");
}
}
//上下扇风
void Kelvinator_sxfan_callback(const String &state)
{
BLINKER_LOG("get button state: ", state);
if (state == BLINKER_CMD_ON)
{
ac.setSwingVertical(true);
ac.send();
Kelvinator_sxfan.color("#00FF00");
Kelvinator_sxfan.text("上下风");
Kelvinator_sxfan.print("on");
kt_fan = true;
}
else if (state == BLINKER_CMD_OFF)
{
ac.setSwingVertical(false);
ac.send();
Kelvinator_sxfan.color("#999999");
Kelvinator_sxfan.text("上下风");
Kelvinator_sxfan.print("off");
kt_fan = false;
}
}
//空调模式按钮
void Kelvinator_setmode_callback(const String &state)
{
if (state == BLINKER_CMD_BUTTON_TAP)
{
kt_mode();
}
}
//空调风速
void slider2_callback(int32_t value)
{
BLINKER_LOG("get slider value: ", value);
nowfan=value;
NUM1.print(nowfan);
ac.setFan(nowfan);
ac.setXFan(true);
ac.send();
}
//空调温度
void slider1_callback(int32_t value)
{
BLINKER_LOG("get slider value: ", value);
nowtemp=value;
NUM2.print(nowtemp);
ac.setTemp(nowtemp);
ac.send();
}
//=======================================电视相关========================================
//电视控制 + 夜灯
//https://www.sioe.cn/yingyong/yanse-rgb-16/ 颜色值
void ds_miotMode(int32_t color)
{
BLINKER_LOG("need set color: ", color);
colorR = color >> 16 & 0xFF;
colorG = color >> 8 & 0xFF;
colorB = color & 0xFF;
BLINKER_LOG("colorR: ", colorR, ", colorG: ", colorG, ", colorB: ", colorB);
BlinkerMIOT.color(color);
BlinkerMIOT.print();
if(colorR == 255 && colorG == 0 && colorB == 0) { //红色
//开关
sentNEC(0x2FD48B7);
} else if(colorR == 0 && colorG == 0 && colorB == 255) { //蓝色
//音量+
for(int i=1; i<=5; i++){ sentNEC(0x2FD58A7); }
} else if(colorR == 0 && colorG == 255 && colorB == 0) { //绿色
//音量-
for(int i=1; i<=5; i++){ sentNEC(0x2FD7887); }
} else if(colorR == 144 && colorG == 238 && colorB == 144) { //浅绿色
//上
sentNEC(0x2FD9867);
} else if(colorR == 0 && colorG == 255 && colorB == 255) { //青色
//下
sentNEC(0x2FDB847);
} else if(colorR == 255 && colorG == 255 && colorB == 0) { //黄色
//左
sentNEC(0x2FD629D);
} else if(colorR == 160 && colorG == 32 && colorB == 240) { //紫色
//右
sentNEC(0x2FDE21D);
} else if(colorR == 255 && colorG == 165 && colorB == 0) { //橘黄色
//返回
sentNEC(0x2FD02FD);
} else if(colorR == 135 && colorG == 206 && colorB == 235) { //天蓝色
//确定
sentNEC(0x2FD50AF);
} else if(colorR == 255 && colorG == 192 && colorB == 203) { //粉红色
//主页
sentNEC(0x2FD8A75);
} else if(colorR == 255 && colorG == 0 && colorB == 255) { //紫红色
//电影模式
sentNEC(0x2FD2AD5);
} else if(colorR == 255 && colorG == 255 && colorB == 255) { //白色
//客厅灯色温分段
fd_fun();
}
}
//电视开关
void ds_power_callback(const String &state)
{
sentNEC(0x2FD48B7);
Blinker.print("ds_power_callback state: ", state);
}
//电视音量+
void ds_ylup_callback(const String &state)
{
sentNEC(0x2FD58A7);
Blinker.print("ds_power_callback state: ", state);
}
//电视音量-
void ds_yldown_callback(const String &state)
{
sentNEC(0x2FD7887);
Blinker.print("ds_power_callback state: ", state);
}
//电视上
void ds_up_callback(const String &state)
{
sentNEC(0x2FD9867);
Blinker.print("ds_power_callback state: ", state);
}
//电视下
void ds_down_callback(const String &state)
{
sentNEC(0x2FDB847);
Blinker.print("ds_power_callback state: ", state);
}
//电视左
void ds_left_callback(const String &state)
{
sentNEC(0x2FD629D);
Blinker.print("ds_power_callback state: ", state);
}
//电视右
void ds_rigt_callback(const String &state)
{
sentNEC(0x2FDE21D);
Blinker.print("ds_power_callback state: ", state);
}
//电视确定
void ds_ok_callback(const String &state)
{
sentNEC(0x2FD50AF);
Blinker.print("ds_power_callback state: ", state);
}
//电视返回
void ds_back_callback(const String &state)
{
sentNEC(0x2FD02FD);
Blinker.print("ds_power_callback state: ", state);
}
//电视电影模式
void ds_movie_callback(const String &state)
{
sentNEC(0x2FD2AD5);
Blinker.print("ds_power_callback state: ", state);
}
//电视主页
void ds_home_callback(const String &state)
{
sentNEC(0x2FD8A75);
Blinker.print("ds_power_callback state: ", state);
}
//电视信号源
void ds_signal_callback(const String &state)
{
sentNEC(0x2FDE817);
Blinker.print("ds_power_callback state: ", state);
}
// 如果未绑定的组件被触发,则会执行其中内容
void dataRead(const String & data)
{
Blinker.print("Blinker readString: ", data);
Blinker.vibrate();
}
void setup() {
irsend.begin();
Serial.begin(115200);
btn_power.attach(btn_power_callback);
btn_yd.attach(btn_yd_callback);
sw_up.attach(sw_up_callback);
sw_down.attach(sw_down_callback);
sw_fd.attach(sw_fd_callback);
ld_up.attach(ld_up_callback);
ld_down.attach(ld_down_callback);
BLINKER_DEBUG.stream(Serial);
BLINKER_DEBUG.debugAll();
//Blinker.begin(auth,ssid,pswd);
Blinker.begin(auth);
Blinker.attachData(dataRead);
BlinkerMIOT.attachPowerState(miotPowerState);
BlinkerMIOT.attachBrightness(miotBright);
BlinkerMIOT.attachColorTemperature(miotColoTemp);
Blinker.attachHeartbeat(heartbeat);
BlinkerMIOT.attachQuery(miotQuery);
BlinkerMIOT.attachMode(kt_miotMode);
BlinkerMIOT.attachColor(ds_miotMode);
ac.begin();
Kelvinator_power.attach(Kelvinator_power_callback);
Kelvinator_setmode.attach(Kelvinator_setmode_callback);
Kelvinator_Light.attach(Kelvinator_Light_callback);
Kelvinator_sxfan.attach(Kelvinator_sxfan_callback);
Slider1.attach(slider1_callback);
Slider2.attach(slider2_callback);
Serial.println("Default state of the remote.");
printState();
Serial.println("Setting desired state for A/C.");
colorR = 255;
colorG = 255;
colorB = 255;
colorW = 0;
wsState = true;
}
void loop() {
Blinker.run();
}[/mw_shl_code]
现在就可以愉快的叫小爱控制灯、空调、电视了.....
使用问题汇总:
小爱经常收到指令后经常提示:
1、“已帮你操作了,看看设备状态吧”一般会几秒后设备才响应
2、设备好像不理小爱呢;不知道是不是回调用了耗时操作delay(),但控制在500ms 应该也不影响呀
其它问题待发现...
|
|