|
在使用Arduino mega+mega的WiFi扩展板调试Blinker中遇到的问题,串口显示:
- <div>[5114] Freeheap: 6015
- [5114] Response: AT
- [5115] Success...
- [5122] Freeheap: 6155
- [6113] print: AT
- [6113] Proto print...
- [6114] Freeheap: 6015
- [6114] Response: AT
- [6115] Success...</div>
复制代码
商家提供的示例文件(http://wiki.waaax.top/index.php?title=MEGA2560_WIFI)用的阿里云,MQTT协议,Wifi模块是ESP8266MOD,不知道该怎么调/(ㄒoㄒ)/。
调试代码如下,在ESP32上可运行。
- #define BLINKER_WIFI
- #include <Blinker.h>
- char auth[] = "7f48d0909b3f";
- char ssid[] = "AA";
- char pswd[] = "88888888";
- // 新建组件对象
- BlinkerButton Button1("btn-abc");
- // 按下按键即会执行该函数
- void button1_callback(const String & state) {
- BLINKER_LOG("get button state: ", state);
- digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
- Blinker.vibrate();
- }
- void setup() {
-
- Serial.begin(115200);
- BLINKER_DEBUG.stream(Serial);
- BLINKER_DEBUG.debugAll();
- // 初始化有LED的IO
- pinMode(LED_BUILTIN, OUTPUT);
- digitalWrite(LED_BUILTIN, HIGH);
- // 初始化blinker
- Blinker.begin(auth, ssid, pswd);
- Button1.attach(button1_callback);
- }
- void loop() {
- Blinker.run();
- }
复制代码
|
|