示例程序编译错误-Arduino中文社区 - Powered by Discuz! Archiver

雾失迷津 发表于 2019-12-4 17:51

示例程序编译错误

C:\Users\85988\AppData\Local\Arduino15\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:10766:41: error: invalid type argument of unary '*' (have 'int')






示例程序
#define BLINKER_WIFI


#include <Blinker.h>


char auth[] = "Your Device Secret Key";
char ssid[] = "Your WiFi network SSID or name";
char pswd[] = "Your WiFi network WPA password or WEP key";


#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.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.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.text("Your button name", "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(auth, ssid, pswd);
    Blinker.attachData(dataRead);
    Button1.attach(button1_callback);
}


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

coloz 发表于 2019-12-4 20:55

确保lib为最新版本,package版本2.5.0以上

雾失迷津 发表于 2019-12-8 19:12

coloz 发表于 2019-12-4 20:55
确保lib为最新版本,package版本2.5.0以上

blinker库是在官网下载的最新安装包

jlsp1910 发表于 2019-12-8 20:25

我也用的示例程序,没有问题啊

雾失迷津 发表于 2019-12-9 16:11

雾失迷津 发表于 2019-12-8 19:12
blinker库是在官网下载的最新安装包

exit status 1
为开发板 NodeMCU 1.0 (ESP-12E Module) 编译时出错。

雾失迷津 发表于 2019-12-9 16:11

jlsp1910 发表于 2019-12-8 20:25
我也用的示例程序,没有问题啊

exit status 1
为开发板 NodeMCU 1.0 (ESP-12E Module) 编译时出错。
页: [1]
查看完整版本: 示例程序编译错误