정보나눔

오픈소스하드웨어 프로젝트에 대한 다양한 정보를 나누는 공간입니다.

아두이노 hm-10 비콘 컴파일에 관하여
학생12345 | 2019-10-28

사용 라이브러리 : https://github.com/ArduinoForBeginners/Beacon

 

안녕하세요. 아두이노와 hm-10 블루투스 4.0 BLE 모듈을 이용해 비콘기능을 해보려고 하는데,

관련 코드를 아예 몰라서 github에 있는 라이브러리를 찾아서 추가한 뒤 컴파일을 해보았더니 다음과 같은 에러가 뜨면서 아예 컴파일이 되지 않습니다.

 

아두이노:1.8.7 (Windows 7), 보드:"Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

경고: 라이브러리 Beacon Library에서 카테고리 ''가 유효하지 않습니다. 'Uncategorized'로 설정
C:\Users\404\Documents\Arduino\libraries\Beacon-master\Beacon.cpp: In member function 'void Beacon::setMajor(unsigned int)':

C:\Users\404\Documents\Arduino\libraries\Beacon-master\Beacon.cpp:50:16: error: no match for 'operator+=' (operand types are 'String' and 'void')

   beacon_major += String(major, HEX).toUpperCase();

   ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In file included from C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/Arduino.h:231:0,

                 from C:\Users\404\Documents\Arduino\libraries\Beacon-master\Beacon.cpp:1:

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:113:11: note: candidate: String& String::operator+=(const String&)

  String & operator += (const String &rhs) {concat(rhs); return (*this);}

           ^~~~~~~~

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:113:11: note:   no known conversion for argument 1 from 'void' to 'const String&'

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:114:11: note: candidate: String& String::operator+=(const char*)

  String & operator += (const char *cstr)  {concat(cstr); return (*this);}

           ^~~~~~~~

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:114:11: note:   no known conversion for argument 1 from 'void' to 'const char*'

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:115:11: note: candidate: String& String::operator+=(char)

  String & operator += (char c)   {concat(c); return (*this);}

           ^~~~~~~~

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:115:11: note:   no known conversion for argument 1 from 'void' to 'char'

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:116:11: note: candidate: String& String::operator+=(unsigned char)

  String & operator += (unsigned char num)  {concat(num); return (*this);}

           ^~~~~~~~

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:116:11: note:   no known conversion for argument 1 from 'void' to 'unsigned char'

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:117:11: note: candidate: String& String::operator+=(int)

  String & operator += (int num)   {concat(num); return (*this);}

           ^~~~~~~~

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:117:11: note:   no known conversion for argument 1 from 'void' to 'int'

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:118:11: note: candidate: String& String::operator+=(unsigned int)

  String & operator += (unsigned int num)  {concat(num); return (*this);}

           ^~~~~~~~

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:118:11: note:   no known conversion for argument 1 from 'void' to 'unsigned int'

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:119:11: note: candidate: String& String::operator+=(long int)

  String & operator += (long num)   {concat(num); return (*this);}

           ^~~~~~~~

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:119:11: note:   no known conversion for argument 1 from 'void' to 'long int'

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:120:11: note: candidate: String& String::operator+=(long unsigned int)

  String & operator += (unsigned long num) {concat(num); return (*this);}

           ^~~~~~~~

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:120:11: note:   no known conversion for argument 1 from 'void' to 'long unsigned int'

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:121:11: note: candidate: String& String::operator+=(float)

  String & operator += (float num)  {concat(num); return (*this);}

           ^~~~~~~~

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:121:11: note:   no known conversion for argument 1 from 'void' to 'float'

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:122:11: note: candidate: String& String::operator+=(double)

  String & operator += (double num)  {concat(num); return (*this);}

           ^~~~~~~~

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:122:11: note:   no known conversion for argument 1 from 'void' to 'double'

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:123:11: note: candidate: String& String::operator+=(const __FlashStringHelper*)

  String & operator += (const __FlashStringHelper *str){concat(str); return (*this);}

           ^~~~~~~~

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:123:11: note:   no known conversion for argument 1 from 'void' to 'const __FlashStringHelper*'

C:\Users\404\Documents\Arduino\libraries\Beacon-master\Beacon.cpp:53:22: error: invalid operands of types 'const char [2]' and 'void' to binary 'operator+'

   beacon_major += "0"+ String(major, HEX).toUpperCase();

                   ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

C:\Users\404\Documents\Arduino\libraries\Beacon-master\Beacon.cpp:56:23: error: invalid operands of types 'const char [3]' and 'void' to binary 'operator+'

   beacon_major += "00"+ String(major, HEX).toUpperCase();

                   ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

C:\Users\404\Documents\Arduino\libraries\Beacon-master\Beacon.cpp:59:24: error: invalid operands of types 'const char [4]' and 'void' to binary 'operator+'

   beacon_major += "000"+ String(major, HEX).toUpperCase();

                   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

C:\Users\404\Documents\Arduino\libraries\Beacon-master\Beacon.cpp: In member function 'void Beacon::setMinor(unsigned int)':

C:\Users\404\Documents\Arduino\libraries\Beacon-master\Beacon.cpp:76:16: error: no match for 'operator+=' (operand types are 'String' and 'void')

   beacon_minor += String(minor, HEX).toUpperCase();

   ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In file included from C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/Arduino.h:231:0,

                 from C:\Users\404\Documents\Arduino\libraries\Beacon-master\Beacon.cpp:1:

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:113:11: note: candidate: String& String::operator+=(const String&)

  String & operator += (const String &rhs) {concat(rhs); return (*this);}

           ^~~~~~~~

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:113:11: note:   no known conversion for argument 1 from 'void' to 'const String&'

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:114:11: note: candidate: String& String::operator+=(const char*)

  String & operator += (const char *cstr)  {concat(cstr); return (*this);}

           ^~~~~~~~

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:114:11: note:   no known conversion for argument 1 from 'void' to 'const char*'

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:115:11: note: candidate: String& String::operator+=(char)

  String & operator += (char c)   {concat(c); return (*this);}

           ^~~~~~~~

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:115:11: note:   no known conversion for argument 1 from 'void' to 'char'

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:116:11: note: candidate: String& String::operator+=(unsigned char)

  String & operator += (unsigned char num)  {concat(num); return (*this);}

           ^~~~~~~~

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:116:11: note:   no known conversion for argument 1 from 'void' to 'unsigned char'

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:117:11: note: candidate: String& String::operator+=(int)

  String & operator += (int num)   {concat(num); return (*this);}

           ^~~~~~~~

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:117:11: note:   no known conversion for argument 1 from 'void' to 'int'

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:118:11: note: candidate: String& String::operator+=(unsigned int)

  String & operator += (unsigned int num)  {concat(num); return (*this);}

           ^~~~~~~~

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:118:11: note:   no known conversion for argument 1 from 'void' to 'unsigned int'

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:119:11: note: candidate: String& String::operator+=(long int)

  String & operator += (long num)   {concat(num); return (*this);}

           ^~~~~~~~

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:119:11: note:   no known conversion for argument 1 from 'void' to 'long int'

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:120:11: note: candidate: String& String::operator+=(long unsigned int)

  String & operator += (unsigned long num) {concat(num); return (*this);}

           ^~~~~~~~

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:120:11: note:   no known conversion for argument 1 from 'void' to 'long unsigned int'

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:121:11: note: candidate: String& String::operator+=(float)

  String & operator += (float num)  {concat(num); return (*this);}

           ^~~~~~~~

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:121:11: note:   no known conversion for argument 1 from 'void' to 'float'

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:122:11: note: candidate: String& String::operator+=(double)

  String & operator += (double num)  {concat(num); return (*this);}

           ^~~~~~~~

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:122:11: note:   no known conversion for argument 1 from 'void' to 'double'

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:123:11: note: candidate: String& String::operator+=(const __FlashStringHelper*)

  String & operator += (const __FlashStringHelper *str){concat(str); return (*this);}

           ^~~~~~~~

C:\Users\404\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\cores\arduino/WString.h:123:11: note:   no known conversion for argument 1 from 'void' to 'const __FlashStringHelper*'

C:\Users\404\Documents\Arduino\libraries\Beacon-master\Beacon.cpp:79:22: error: invalid operands of types 'const char [2]' and 'void' to binary 'operator+'

   beacon_minor += "0"+ String(minor, HEX).toUpperCase();

                   ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

C:\Users\404\Documents\Arduino\libraries\Beacon-master\Beacon.cpp:82:23: error: invalid operands of types 'const char [3]' and 'void' to binary 'operator+'

   beacon_minor += "00"+ String(minor, HEX).toUpperCase();

                   ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

C:\Users\404\Documents\Arduino\libraries\Beacon-master\Beacon.cpp:85:24: error: invalid operands of types 'const char [4]' and 'void' to binary 'operator+'

   beacon_minor += "000"+ String(minor, HEX).toUpperCase();

                   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

C:\Users\404\Documents\Arduino\libraries\Beacon-master\Beacon.cpp: At global scope:

C:\Users\404\Documents\Arduino\libraries\Beacon-master\Beacon.cpp:95:8: error: expected constructor, destructor, or type conversion before 'Advertising'

  * Set Advertising Type

        ^~~~~~~~~~~

exit status 1
보드 Arduino/Genuino Mega or Mega 2560 컴파일 에러.

 

라이브러리를 추가만 했을 뿐인데 에러메시지도 엄청 많이 뜨고 개별 검색해서 구글링도 시도해 보았으나 뚜렷한 답을 찾기가 너무 어렵습니다. 도와주세요...

 

아두이노 메가 2560, hm-10 쓰고 있습니다.

이전글   |    아두이노 오류.. 2019-10-28
다음글   |    조이스틱 센서쉴드 사용 중 아두이노/프로세싱 업로드 오류... 2019-10-29