wifiduino程序上传出错-Arduino中文社区 - Powered by Discuz!

Arduino中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 2293|回复: 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
发表于 2019-7-28 12:51 | 显示全部楼层
本帖最后由 zjssun 于 2019-7-28 12:54 编辑

dataRead没有声明是什么,你可以去掉或写个dataRead函数 看文档吧
发表于 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
发表于 2019-7-28 18:34 | 显示全部楼层
abcd2019 发表于 2019-7-28 13:34
是4567引脚不能用吗?

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

本版积分规则

小黑屋|Archiver|手机版|Arduino中文社区

GMT+8, 2024-11-28 20:49 , Processed in 0.075945 second(s), 19 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表