JDY-18接入blinker问题
[*]硬件: Arduino DUE 蓝牙模块 JDY-18
[*]接入方式: BLE
[*]package版本:
[*]blinker库版本: arduino 0.3.2
[*]开发环境: Arduino
[*]操作系统: Windows
[*]手机IPhoneX App版本blinker 2
[*]手机连接显示蓝牙连接超时
[*]程序如下:
#define BLINKER_BLE
#include <Blinker.h>
#define BUTTON_1 "ButtonKey"
BlinkerButton Button1(BUTTON_1);
void button1_callback(const String & state)
{
digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
BLINKER_LOG("get button state: ", state);
if (state == BLINKER_CMD_BUTTON_TAP) {
BLINKER_LOG("Button tap!");
Button1.icon("icon_1");
Button1.color("#FFFFFF");
Button1.text("Your button name or describe");
// Button1.text("Your button name", "describe");
Button1.print();
}
else if (state == BLINKER_CMD_BUTTON_PRESSED) {
BLINKER_LOG("Button pressed!");
Button1.icon("icon_1");
Button1.color("#FFFFFF");
Button1.text("Your button name or describe");
// Button1.text("Your button name", "describe");
Button1.print();
}
else if (state == BLINKER_CMD_BUTTON_RELEASED) {
BLINKER_LOG("Button released!");
Button1.icon("icon_1");
Button1.color("#FFFFFF");
Button1.text("Your button name or describe");
// Button1.text("Your button name", "describe");
Button1.print();
}
else if (state == BLINKER_CMD_ON) {
BLINKER_LOG("Toggle on!");
Button1.icon("icon_1");
Button1.color("#FFFFFF");
Button1.text("Your button name or describe");
// Button1.text("Your button name", "describe");
Button1.print("on");
}
else if (state == BLINKER_CMD_OFF) {
BLINKER_LOG("Toggle off!");
Button1.icon("icon_1");
Button1.color("#FFFFFF");
Button1.text("Your button name or describe");
// Button1.text("Your button name", "describe");
Button1.print("off");
}
else {
BLINKER_LOG("Get user setting: ", state);
Button1.icon("icon_1");
Button1.color("#FFFFFF");
Button1.text("Your button name or describe");
Button1.print();
}
}
void dataRead(const String & data)
{
BLINKER_LOG("Blinker readString: ", data);
Blinker.vibrate();
uint32_t BlinkerTime = millis();
Blinker.print("millis", BlinkerTime);
}
void setup()
{
Serial.begin(115200);
BLINKER_DEBUG.stream(Serial);
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, LOW);
Blinker.begin(15,14,9600);
Button1.attach(button1_callback);
Blinker.attachData(dataRead);
}
void loop()
{
Blinker.run();
}
[*]串口显示 SerialBLE initialized...
[*]接线方式ble----------due
[*] gnd ---------- gnd
[*] vcc ----------- 3.3V
[*] tx------------ 14
[*] rx------------ 15
[*]
发现蓝牙DIY设备无法连接的原因了,确实是我们的一个更改造成的。
现象是,最近一周添加的设备无法连接,之前添加的不受影响。
等我们明天修复了,即可正常使用蓝牙设备。 请在blinker QQ群联系 奈何col,为弥补您浪费的时间,将免费赠送认证开发者资格 问题已修复,感谢您的测试
页:
[1]