查看: 386|回复: 4

[已解答] wifiduino程序上传出错

[复制链接]

该用户从未签到

发表于 2019-7-28 12:29 | 显示全部楼层 |阅读模式
希望大佬帮忙看下~
完整代码(就是根据Blinker技术文档里的实例略加修改)如下

#define BLINKER_PRINT Serial
#define BLINKER_WIFI

#include <Blinker.h>

char auth[] = "625cfae33206";
char ssid[] = "CuMoon";
char pswd[] = "147532515117";


//设置电机控制引脚
int DIR1 = 4;        //棕   
int PWM1 = 5;        //红
int PWM2 = 6;        //橙                        
int DIR2 = 7;        //黄

// 新建组件对象
BlinkerButton Button1("btn-abc");
BlinkerNumber Number1("num-abc");

int counter = 0;

// 按下按键即会执行该函数
void button1_callback(const String & state) {
    BLINKER_LOG("get button state: ", state);
    digitalWrite(DIR1,LOW);
    digitalWrite(DIR2,LOW);
    analogWrite(PWM1,255);
    analogWrite(PWM2,255);
}


void setup() {
    // 初始化串口
    Serial.begin(115200);

    #if defined(BLINKER_PRINT)
        BLINKER_DEBUG.stream(BLINKER_PRINT);
    #endif

    // 初始化有LED的IO
    pinMode(LED_BUILTIN, OUTPUT);
    digitalWrite(LED_BUILTIN, HIGH);
    // 初始化blinker
    Blinker.begin(auth, ssid, pswd);
    Blinker.attachData(dataRead);
    Button1.attach(button1_callback);
    //
    pinMode(DIR1,OUTPUT);
    pinMode(PWM1,OUTPUT);
    pinMode(PWM2,OUTPUT);
    pinMode(DIR2,OUTPUT);
}

void loop() {
    Blinker.run();
}




////////////////////////////
错误信息如下
Arduino:1.8.7 (Windows 10), 开发板:"WiFiduino, 80 MHz, Flash, Disabled, All SSL ciphers (most compatible), 4M (no SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 921600"

In file included from C:\Users\齐\Documents\Arduino\libraries\blinker-library-master\src/BlinkerESPMQTT.h:10:0,

                 from C:\Users\齐\Documents\Arduino\libraries\blinker-library-master\src/Blinker.h:36,

                 from C:\Users\璇歌憶淇綈\Desktop\Hello_WiFi\Hello_WiFi.ino:6:

C:\Users\齐\Documents\Arduino\libraries\blinker-library-master\src/Adapters/BlinkerMQTT.h: In member function 'virtual char* BlinkerMQTT::lastRead()':

C:\Users\齐\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\齐\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:82:0,

                 from C:\Users\齐\Documents\Arduino\libraries\blinker-library-master\src/BlinkerESPMQTT.h:11,

                 from C:\Users\齐\Documents\Arduino\libraries\blinker-library-master\src/Blinker.h:36,

                 from C:\Users\璇歌憶淇綈\Desktop\Hello_WiFi\Hello_WiFi.ino:6:

C:\Users\齐\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApiBase.h: In member function 'char* BlinkerBridge_key::getName()':

C:\Users\齐\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\齐\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:83:0,

                 from C:\Users\齐\Documents\Arduino\libraries\blinker-library-master\src/BlinkerESPMQTT.h:11,

                 from C:\Users\齐\Documents\Arduino\libraries\blinker-library-master\src/Blinker.h:36,

                 from C:\Users\璇歌憶淇綈\Desktop\Hello_WiFi\Hello_WiFi.ino:6:

C:\Users\齐\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerProtocol.h: In member function 'char* BlinkerProtocol::deviceName()':

C:\Users\齐\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerProtocol.h:96:86: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

             char * deviceName() { if (isInit) return conn->deviceName(); else return ""; }

                                                                                      ^

C:\Users\齐\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerProtocol.h: In member function 'char* BlinkerProtocol::authKey()':

C:\Users\齐\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerProtocol.h:97:83: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

             char * authKey()    { if (isInit) return conn->authKey(); else return "";  }

                                                                                   ^

C:\Users\齐\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerProtocol.h: In member function 'char* BlinkerProtocol::dataParse()':

C:\Users\齐\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerProtocol.h:226: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\齐\Documents\Arduino\libraries\blinker-library-master\src/BlinkerESPMQTT.h:11:0,

                 from C:\Users\齐\Documents\Arduino\libraries\blinker-library-master\src/Blinker.h:36,

                 from C:\Users\璇歌憶淇綈\Desktop\Hello_WiFi\Hello_WiFi.ino:6:

C:\Users\齐\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: At global scope:

C:\Users\齐\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:762:97: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

         BlinkerWidgets_string _BUILTIN_SWITCH = BlinkerWidgets_string(BLINKER_CMD_BUILTIN_SWITCH);

                                                                                                 ^

C:\Users\齐\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::bridgeKey(uint8_t)':

C:\Users\齐\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:6258:21: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

         else return "";

                     ^

C:\Users\齐\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::bridgeName(uint8_t)':

C:\Users\齐\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:6265:21: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

         else return "false";

                     ^

C:\Users\齐\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_str(uint8_t)':

C:\Users\齐\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:6887:17: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

     else return "";

                 ^

C:\Users\齐\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_rgb(uint8_t)':

C:\Users\齐\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:6901:17: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

     else return "";

                 ^

C:\Users\齐\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_int(uint8_t)':

C:\Users\齐\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:6907:17: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

     else return "";

                 ^

C:\Users\齐\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_tab(uint8_t)':

C:\Users\齐\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:6913:17: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

     else return "";

                 ^

C:\Users\璇歌憶淇綈\Desktop\Hello_WiFi\Hello_WiFi.ino: At global scope:

C:\Users\璇歌憶淇綈\Desktop\Hello_WiFi\Hello_WiFi.ino:20:32: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

C:\Users\璇歌憶淇綈\Desktop\Hello_WiFi\Hello_WiFi.ino:21:32: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

C:\Users\璇歌憶淇綈\Desktop\Hello_WiFi\Hello_WiFi.ino: In function 'void setup()':

Hello_WiFi:48:24: error: 'dataRead' was not declared in this scope

exit status 1
'dataRead' was not declared in this scope

在文件 -> 首选项开启
“编译过程中显示详细输出”选项
这份报告会包含更多信息。


微信图片_20190728122520.jpg
  • TA的每日心情
    慵懒
    2019-12-7 21:17
  • 签到天数: 54 天

    [LV.5]常住居民I

    发表于 2019-7-28 12:51 | 显示全部楼层
    本帖最后由 zjssun 于 2019-7-28 12:54 编辑

    dataRead没有声明是什么,你可以去掉或写个dataRead函数 看文档吧
  • TA的每日心情
    郁闷
    2018-12-6 22:21
  • 签到天数: 48 天

    [LV.5]常住居民I

    发表于 2019-7-28 12:52 | 显示全部楼层
    Hello_WiFi:48:24: error: 'dataRead' was not declared in this scope
    翻译过来的意思:
    你程序中没有定义dataRead
    建议按照blinker文档教程学习,理解后,再自由发挥

    该用户从未签到

     楼主| 发表于 2019-7-28 13:34 | 显示全部楼层
    是4567引脚不能用吗?

    点评

    6、7不行  详情 回复 发表于 2019-7-28 18:34
  • TA的每日心情
    郁闷
    2018-12-6 22:21
  • 签到天数: 48 天

    [LV.5]常住居民I

    发表于 2019-7-28 18:34 | 显示全部楼层
    abcd2019 发表于 2019-7-28 13:34
    是4567引脚不能用吗?

    6、7不行
    可见:
    https://wifiduino.com/
    您需要登录后才可以回帖 登录 | 立即注册  

    本版积分规则

    热门推荐

    Blynk与m5stack basic以及uiflow的交互玩法
    Blynk与m5stack basic以及
    Blynk与m5stack basic以及uiflow的交互玩法 [准备工作我们假设玩家已经熟悉下面的准备
    中文 字库 的8针 OLED 12864模块 arduino
    中文 字库 的8针 OLED 128
    屏幕电路SPI连线: 中文字库OLED Arduino UNO GND GND
    【零知ESP8266项目篇】1 OLED天气时钟
    【零知ESP8266项目篇】1 O
    引述: 我们一起学了这么久的零知ESP8266的教程,是不是该检验一下自己了呢?在前面的
    创客集结号:温馨水杯
    创客集结号:温馨水杯
    今天,在创客集结号平台看到一个能自动感应的杯子,不仅神奇还非常有创意,该作品主要
    下载库报错
    下载库报错
    我在编写arduino1602液晶屏温湿度下载DHT_sensor_library库时,下载了库后,还没有改
    Copyright   ©2015-2016  Arduino中文社区  Powered by©Discuz!   
    快速回复 返回顶部 返回列表