奈何col
发表于 2019-4-11 09:10
LaDaDee 发表于 2019-4-9 18:02
你好 uno的板子 和esp 模块的话 代码要怎么改 只需要添加相关引脚么
需要先给8266模块烧入blinker固件,详见:
https://doc.blinker.app/?file=001-快速开始/10-esp8266模块-WiFi接入
LaDaDee
发表于 2019-4-11 17:01
然后就按照帖子里的操作就可以了么
meiki
发表于 2019-6-9 17:50
我程序上载到ESP32 WIFI,然后APP上每按键一次输出会反转,但调试窗口显示的按键状态一直是ON,这是哪里有问题呢?
奈何col
发表于 2019-6-9 19:01
meiki 发表于 2019-6-9 17:50
我程序上载到ESP32 WIFI,然后APP上每按键一次输出会反转,但调试窗口显示的按键状态一直是ON,这是哪里有 ...
不太明白,请详细描述下问题,如果有图请配图
优咪酱
发表于 2019-6-12 18:30
您好,我用您的教程试着做实验,为什么我的Arduino D1设备一直显示离线状态,刷新也不行?
以下是我的代码
#define BLINKER_PRINT Serial
#define BLINKER_WIFI
#include<Blinker.h>
char auth[]="f2fd33cf128e";//Secret Key
char ssid[]="daidai";//要连接的 WiFi 热点名称
char pswd[]="cxm123456789";// WiFi 密码
// 新建组件对象
BlinkerButton Button1("btn-abc");
BlinkerButton Button2("btn-111");
BlinkerButton Button3("btn-222");
BlinkerButton Button4("btn-333");
BlinkerNumber Number1("num-abc");
int counter=0;
int valuer=digitalRead(15); // 定义引脚
int valuey=digitalRead(13);
int valuew=digitalRead(12);
// 按下按键即会执行该函数
void button1_callback(const String&state)
{
BLINKER_LOG("get button state:",state);
digitalWrite(LED_BUILTIN,!digitalRead(LED_BUILTIN));
Blinker.vibrate();
}
void button2_callback(const String&state)
{
BLINKER_LOG("get button state:",state);
digitalWrite(15,!digitalRead(15));
Blinker.vibrate();
}
void button3_callback(const String&state)
{
BLINKER_LOG("get button state:",state);
digitalWrite(13,!digitalRead(13));
Blinker.vibrate();
}
void button4_callback(const String&state)
{
BLINKER_LOG("get button state:",state);
digitalWrite(12,!digitalRead(12));
Blinker.vibrate();
}
void dataRead(const String&data)
{
BLINKER_LOG("BlinkerreadString:",data);
counter++;
Number1.print(counter);
Blinker.vibrate();
}
void setup()
{ // 初始化串口
Serial.begin(115200);
#if defined(BLINKER_PRINT)
//BLINKER_DEBUG.stream(Serial);//开启调试信息
//BLINKER_DEBUG.debugAll();//查看更多内部信息
#endif
//初始化有LED的IO
pinMode(LED_BUILTIN,OUTPUT);
digitalWrite(LED_BUILTIN,HIGH);
pinMode(15,OUTPUT);
digitalWrite(15,HIGH);
pinMode(13,OUTPUT);
digitalWrite(13,HIGH);
pinMode(12,OUTPUT);
digitalWrite(12,HIGH);
// 初始化blinker
Blinker.begin(ssid,pswd);
Blinker.attachData(dataRead);
Button1.attach(button1_callback);
Button2.attach(button2_callback);
Button3.attach(button3_callback);
Button4.attach(button4_callback);
}
void loop()
{
Blinker.run();
}
奈何col
发表于 2019-6-12 19:47
优咪酱 发表于 2019-6-12 18:30
您好,我用您的教程试着做实验,为什么我的Arduino D1设备一直显示离线状态,刷新也不行?
以下是我的代码
...
1.测试例程,看是否正常,如果正常的话,就是程序问题。
2.如果希望获得指导,请描述清楚问题,具体可见提问指南:
https://www.arduino.cn/thread-83658-1-1.html
夏天的风HUST
发表于 2019-7-4 10:01
Arduino:1.8.9 (Windows 10), 开发板:"NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Disabled, 4M (no SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 115200"
构建选项已变更,全部重新构建
In file included from C:\Users\LSG\Documents\Arduino\libraries\blinker-library-master\src/BlinkerESPMQTT.h:10:0,
from C:\Users\LSG\Documents\Arduino\libraries\blinker-library-master\src/Blinker.h:36,
from C:\Users\LSG\Documents\Arduino\WIFI\WIFI.ino:3:
C:\Users\LSG\Documents\Arduino\libraries\blinker-library-master\src/Adapters/BlinkerMQTT.h: In member function 'virtual char* BlinkerMQTT::lastRead()':
C:\Users\LSG\Documents\Arduino\libraries\blinker-library-master\src/Adapters/BlinkerMQTT.h:684:17: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
else return "";
^
In file included from C:\Users\LSG\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:78:0,
from C:\Users\LSG\Documents\Arduino\libraries\blinker-library-master\src/BlinkerESPMQTT.h:11,
from C:\Users\LSG\Documents\Arduino\libraries\blinker-library-master\src/Blinker.h:36,
from C:\Users\LSG\Documents\Arduino\WIFI\WIFI.ino:3:
C:\Users\LSG\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApiBase.h: In member function 'char* BlinkerBridge_key::getName()':
C:\Users\LSG\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApiBase.h:194:29: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
else return "false";
^
In file included from C:\Users\LSG\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:79:0,
from C:\Users\LSG\Documents\Arduino\libraries\blinker-library-master\src/BlinkerESPMQTT.h:11,
from C:\Users\LSG\Documents\Arduino\libraries\blinker-library-master\src/Blinker.h:36,
from C:\Users\LSG\Documents\Arduino\WIFI\WIFI.ino:3:
C:\Users\LSG\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerProtocol.h: In member function 'char* BlinkerProtocol::deviceName()':
C:\Users\LSG\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerProtocol.h:95:86: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
char * deviceName() { if (isInit) return conn->deviceName(); else return ""; }
^
C:\Users\LSG\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerProtocol.h: In member function 'char* BlinkerProtocol::authKey()':
C:\Users\LSG\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerProtocol.h:96:83: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
char * authKey() { if (isInit) return conn->authKey(); else return "";}
^
C:\Users\LSG\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerProtocol.h: In member function 'char* BlinkerProtocol::dataParse()':
C:\Users\LSG\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerProtocol.h:214:86: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
char* dataParse() { if (canParse) return conn->lastRead(); else return ""; }
^
In file included from C:\Users\LSG\Documents\Arduino\libraries\blinker-library-master\src/BlinkerESPMQTT.h:11:0,
from C:\Users\LSG\Documents\Arduino\libraries\blinker-library-master\src/Blinker.h:36,
from C:\Users\LSG\Documents\Arduino\WIFI\WIFI.ino:3:
C:\Users\LSG\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: At global scope:
C:\Users\LSG\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:715:97: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
BlinkerWidgets_string _BUILTIN_SWITCH = BlinkerWidgets_string(BLINKER_CMD_BUILTIN_SWITCH);
^
C:\Users\LSG\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'void BlinkerApi::run()':
C:\Users\LSG\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:3380:9: error: 'meshCheck' is not a member of 'BProto {aka BlinkerProtocol}'
BProto::meshCheck();
^
C:\Users\LSG\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::bridgeKey(uint8_t)':
C:\Users\LSG\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:5568:21: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
else return "";
^
C:\Users\LSG\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::bridgeName(uint8_t)':
C:\Users\LSG\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:5575:21: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
else return "false";
^
C:\Users\LSG\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_str(uint8_t)':
C:\Users\LSG\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:6140:17: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
else return "";
^
C:\Users\LSG\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_rgb(uint8_t)':
C:\Users\LSG\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:6154:17: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
else return "";
^
C:\Users\LSG\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_int(uint8_t)':
C:\Users\LSG\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:6160:17: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
else return "";
^
C:\Users\LSG\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_tab(uint8_t)':
C:\Users\LSG\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:6166:17: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
else return "";
^
C:\Users\LSG\Documents\Arduino\WIFI\WIFI.ino: At global scope:
C:\Users\LSG\Documents\Arduino\WIFI\WIFI.ino:10:32: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
BlinkerButton Button1("btn-abc");
^
exit status 1
为开发板 NodeMCU 1.0 (ESP-12E Module) 编译时出错。
在文件 -> 首选项开启
“编译过程中显示详细输出”选项
这份报告会包含更多信息。
这是怎么回事?
奈何col
发表于 2019-7-4 10:23
夏天的风HUST 发表于 2019-7-4 10:01
Arduino:1.8.9 (Windows 10), 开发板:"NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Disabled, 4M (no S ...
更新下最新的lib
星空里遗忘昨天
发表于 2019-8-1 15:27
你好,我想问一下为什么会出现这个错误,文件我直接到里面找也是可以找到的,但是编译就是会错误。
奈何col
发表于 2019-9-6 11:51
星空里遗忘昨天 发表于 2019-8-1 15:27
你好,我想问一下为什么会出现这个错误,文件我直接到里面找也是可以找到的,但是编译就是会错误。 ...
请确保lib和package都是最新版本
页:
1
2
[3]
4
5
6
7
8
9
10
11
12