查看: 83|回復: 1
打印 上一主題 下一主題

[已解決] nodemcu使用blinker控制電機轉動,編譯不通過,請問是什么原...

[復制鏈接]

該用戶從未簽到

跳轉到指定樓層
樓主
發表于 2019-10-11 22:21 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
Arduino:1.8.0 (Windows 7), 開發板:"NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Disabled, 4M (no SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 9600"

開發板在 COM5 不可用
開發板在 COM5 不可用
開發板在 COM5 不可用
c:/users/administrator/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: libraries\Blinker\Functions\BlinkerUpdater.cpp.o.text._ZN19BlinkerUpdaterClass10printErrorEv+0x48): undefined reference to `MD5Builder::toString()'

c:/users/administrator/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: libraries\Blinker\Functions\BlinkerUpdater.cpp.o: in function `BlinkerUpdaterClass::printError()':

C:\Users\Administrator\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\cores\esp8266/WString.h:157: undefined reference to `MD5Builder::toString()'

c:/users/administrator/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: libraries\Blinker\Functions\BlinkerUpdater.cpp.o.text._ZN19BlinkerUpdaterClass5beginEjiih+0x54): undefined reference to `MD5Builder::begin()'

c:/users/administrator/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: libraries\Blinker\Functions\BlinkerUpdater.cpp.o: in function `BlinkerUpdaterClass::begin(unsigned int, int, int, unsigned char)':

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src\Functions/BlinkerUpdater.cpp:140: undefined reference to `MD5Builder::begin()'

c:/users/administrator/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: libraries\Blinker\Functions\BlinkerUpdater.cpp.o: in function `BLINKER_LOG_T<const __FlashStringHelper*, unsigned char>':

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerDebug.h:72: undefined reference to `MD5Builder::add(unsigned char const*, unsigned short)'

c:/users/administrator/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: libraries\Blinker\Functions\BlinkerUpdater.cpp.o: in function `BLINKER_LOG_T<FlashMode_t, char const*, FlashMode_t>':

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerDebug.h:72: undefined reference to `MD5Builder::add(unsigned char const*, unsigned short)'

c:/users/administrator/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: libraries\Blinker\Functions\BlinkerUpdater.cpp.o: in function `BLINKER_LOG_T<FlashMode_t>':

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerDebug.h:75: undefined reference to `MD5Builder::calculate()'

c:/users/administrator/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: libraries\Blinker\Functions\BlinkerUpdater.cpp.o: in function `BLINKER_LOG_ALL<const __FlashStringHelper*, unsigned char, const __FlashStringHelper*, unsigned int, unsigned int>':

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerDebug.h:103: undefined reference to `MD5Builder::calculate()'

c:/users/administrator/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: libraries\Blinker\Functions\BlinkerUpdater.cpp.o: in function `BlinkerUpdaterClass::end(bool)':

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerDebug.h:47: undefined reference to `MD5Builder::toString()'

collect2.exe: error: ld returned 1 exit status

"Blinker.h" 對應多個庫
已使用: C:\Users\Administrator\Documents\Arduino\libraries\Blinker
未使用:D:\***\arduino\軟件\arduino-1.8.0\libraries\Blinker
exit status 1
為開發板 NodeMCU 1.0 (ESP-12E Module) 編譯時出錯。

編譯時出錯,代碼如下:
#define BLINKER_PRINT Serial
#define BLINKER_WIFI


#include <Blinker.h>


char auth[] = "*";
char ssid[] = "*";
char pswd[] = "*";


#define IN1 D0
#define IN2 D1
#define IN3 D2
#define IN4 D3
#define tap_time 300
#define press_time 3000
#define press_time_zy 1000


unsigned long t = 0;
unsigned long timeout = 2000;


#define BUTTON_0 "btn-t"
#define BUTTON_1 "btn-s"
#define BUTTON_2 "btn-x"
#define BUTTON_3 "btn-z"
#define BUTTON_4 "btn-y"


#define Txt_1 "tex"


BlinkerText Text1(Txt_1);
BlinkerButton Button0(BUTTON_0);
BlinkerButton Button1(BUTTON_1);
BlinkerButton Button2(BUTTON_2);
BlinkerButton Button3(BUTTON_3);
BlinkerButton Button4(BUTTON_4);


void button0_callback(const String &state)
{
t = millis();
timeout = 2000;
key_parse(0);
}


void button1_callback(const String &state)
{
t = millis();
if (state == BLINKER_CMD_BUTTON_TAP)
{
timeout = tap_time;
key_parse(2);
}
else if (state == BLINKER_CMD_BUTTON_PRESSED)
{
timeout = press_time;
key_parse(0);
}
else if (state == BLINKER_CMD_BUTTON_RELEASED)
key_parse(0);
}
void button2_callback(const String &state)
{
t = millis();
if (state == BLINKER_CMD_BUTTON_TAP)
{
timeout = tap_time;
key_parse(3);
}
else if (state == BLINKER_CMD_BUTTON_PRESSED)
{
timeout = press_time;
key_parse(0);
}
else if (state == BLINKER_CMD_BUTTON_RELEASED)
key_parse(0);
}
void button3_callback(const String &state)
{
t = millis();
if (state == BLINKER_CMD_BUTTON_TAP)
{
timeout = tap_time;
key_parse(4);
}
else if (state == BLINKER_CMD_BUTTON_PRESSED)
{
timeout = press_time_zy;
key_parse(0);
}
else if (state == BLINKER_CMD_BUTTON_RELEASED)
key_parse(0);
}
void button4_callback(const String &state)
{
t = millis();
if (state == BLINKER_CMD_BUTTON_TAP)
{
timeout = tap_time;
key_parse(6);
}
else if (state == BLINKER_CMD_BUTTON_PRESSED)
{
timeout = press_time_zy;
key_parse(0);
}
else if (state == BLINKER_CMD_BUTTON_RELEASED)
key_parse(0);
}


void key_parse(uint8_t car_mode)
{
bool L_DIR1 = HIGH;
bool R_DIR1 = HIGH;
bool L_DIR = HIGH;
bool R_DIR = HIGH;
switch (car_mode)
{
case 2: //上前進
L_DIR=LOW;
L_DIR1=HIGH;
R_DIR=LOW;
R_DIR1=HIGH;
break;
case 3:
//下后退
L_DIR=HIGH;
L_DIR1=LOW;
R_DIR=HIGH;
R_DIR1=LOW;
break;
case 1: //停止
L_DIR=LOW;
L_DIR1=LOW;
R_DIR=LOW;
R_DIR1=LOW;
break;
case 4: //左轉
L_DIR=HIGH;
L_DIR1=LOW;
R_DIR=LOW;
R_DIR1=HIGH;
break;


case 6: //右轉
L_DIR=LOW;
L_DIR1=HIGH;
R_DIR=HIGH;
R_DIR1=LOW;
break;
// case 9://左上press
// break;
// case 10://左下
// break;
// case 11://右上
// break;
// case 12://右下
// break;
}
digitalWrite(IN1, L_DIR);
digitalWrite(IN3, R_DIR);
digitalWrite(IN2, L_DIR1);
digitalWrite(IN4, R_DIR1);
Text1.print("run time", t);
}


void blinker_car_init()
{
pinMode(IN1, OUTPUT);
pinMode(IN4, OUTPUT);
pinMode(IN3, OUTPUT);
pinMode(IN2, OUTPUT);
digitalWrite(IN2, HIGH);
digitalWrite(IN4, HIGH);
digitalWrite(IN1, HIGH);
digitalWrite(IN3, HIGH);
// pinMode(C_BAR_PIN, INPUT_PULLUP);
}
void blinker_car_control(uint8_t cl_pwm, bool cl_dir, uint8_t cr_pwm, bool cr_dir)
{
digitalWrite(IN1, cl_dir);
digitalWrite(IN3, cr_dir);
digitalWrite(IN2, cl_dir);
digitalWrite(IN4, cr_dir);

}
/*
void blinker_car_detect()
{
if (!digitalRead(C_BAR_PIN)) {
if (!isWarn) {
Blinker.vibrate();
isWarn = true;
car_os_time = millis();
}
else if (millis() - car_os_time >= 5000) {
isWarn = false;
}
}
else {
isWarn = false;
}
}
*/
void setup()
{
analogWriteRange(255);
blinker_car_init();


Serial.begin(115200);
BLINKER_DEBUG.stream(Serial);
Blinker.begin(auth, ssid, pswd);
Button0.attach(button0_callback);
Button1.attach(button1_callback);
Button2.attach(button2_callback);
Button3.attach(button3_callback);
Button4.attach(button4_callback);
}


void loop()
{
Blinker.run();
if ((millis() - t) > timeout)
{
t = millis();
timeout = 2000;
blinker_car_init();
//Serial.println("timeout");
}
// blinker_car_detect();
/*#if defined(BLINKER_CAR_DEBUG)
BLINKER_LOG4("L_PWM: ", L_PWM, " | L_DIR: ", L_DIR);
BLINKER_LOG4("R_PWM: ", R_PWM, " | R_DIR: ", R_DIR);
Blinker.delay(2000);
#endif*/
}
參照教程如下:
http://tieba.baidu.com/p/6080487452





  • TA的每日心情
    奮斗
    2019-7-12 18:42
  • 簽到天數: 48 天

    [LV.5]常住居民I

    沙發
    發表于 2019-10-11 23:49 | 只看該作者
    試了下,我這編譯沒問題
    更新下的blinker lib和8266 package
    如果你覺得以上內容幫到了你,你可以打賞支持作者
    您需要登錄后才可以回帖 登錄 | 立即注冊  

    本版積分規則

    熱門推薦

    arduino實現L298N控制工業步進電機
    arduino實現L298N控制工業
    求助 L298N是ST公司生產的一種高電壓、大電流電機驅動芯片。該芯片采用15腳封裝。主
    arduino IDE錯誤,有點崩潰了,要搞作業!
    arduino IDE錯誤,有點崩
    無論編譯什么程序文件都是這個錯誤!程序自帶例程,最簡單的點亮led燈也是 這個 問題
    【項目】基于Arduino Nano的多功能桌面感應垃圾桶
    【項目】基于Arduino Nano
    基于Arduino Nano的多功能桌面感應垃圾桶隨著大學生活不斷往前邁進,宿舍桌面上的雜物
    在芯間投資成立的零知實驗室發布國內的STM32開源開發板
    在芯間投資成立的零知實驗
    在芯間電子元器件商城成立于2016年,是集電子元器件采購、SMT貼片、PCB打樣、于一
    【原創】全球最小口袋3D打印機mini one直播教程貼
    【原創】全球最小口袋3D打
    最近閑得蛋疼,沒事搞個掌上3D打印機,先放效果圖吧。 搞了半天,終于能正常打印,
    Copyright   ©2015-2016  Arduino中文社區  Powered by©Discuz!   ( 蜀ICP備14017632號-3 )
    快速回復 返回頂部 返回列表
    七星彩综合基本走势图