Не идёт компиляция

CoolBoy
Offline
Зарегистрирован: 11.01.2018

Здравствуйте! Такая проблема: пытаюсь компилировать скетч для arduino pro micro, а компиляция не заканчивается. Вот и он:

#define BAUD_RATE 57200

#define ExternSerial Serial1

String * bufferStr = "";
String last = "";

int defaultDelay = 0;

void Line(String _line)
{
  int firstSpace = _line.indexOf(" ");
  if(firstSpace == -1) Press(_line);
  else if(_line.substring(0,firstSpace) == "STRING"){
    for(int i=firstSpace+1;i<_line.length();i++) Keyboard.write(_line[i]);
  }
  else if(_line.substring(0,firstSpace) == "DELAY"){
    int delaytime = _line.substring(firstSpace + 1).toInt();
    delay(delaytime);
  }
  else if(_line.substring(0,firstSpace) == "DEFAULTDELAY") defaultDelay = _line.substring(firstSpace + 1).toInt();
  else if(_line.substring(0,firstSpace) == "REM"){} //nothing :/
  else if(_line.substring(0,firstSpace) == "REPLAY") {
    int replaynum = _line.substring(firstSpace + 1).toInt();
    while(replaynum)
    {
      Line(last);
      --replaynum;
    }
  } else{
      String remain = _line;

      while(remain.length() > 0){
        int latest_space = remain.indexOf(" ");
        if (latest_space == -1){
          Press(remain);
          remain = "";
        }
        else{
          Press(remain.substring(0, latest_space));
          remain = remain.substring(latest_space + 1);
        }
        delay(5);
      }
  }

  Keyboard.releaseAll();
  delay(defaultDelay);
}

void Press(String b){
  if(b.length() == 1) Keyboard.press(char(b[0]));
  else if (b.equals("ENTER")) Keyboard.press(KEY_RETURN);
  else if (b.equals("CTRL")) Keyboard.press(KEY_LEFT_CTRL);
  else if (b.equals("SHIFT")) Keyboard.press(KEY_LEFT_SHIFT);
  else if (b.equals("ALT")) Keyboard.press(KEY_LEFT_ALT);
  else if (b.equals("GUI")) Keyboard.press(KEY_LEFT_GUI);
  else if (b.equals("UP") || b.equals("UPARROW")) Keyboard.press(KEY_UP_ARROW);
  else if (b.equals("DOWN") || b.equals("DOWNARROW")) Keyboard.press(KEY_DOWN_ARROW);
  else if (b.equals("LEFT") || b.equals("LEFTARROW")) Keyboard.press(KEY_LEFT_ARROW);
  else if (b.equals("RIGHT") || b.equals("RIGHTARROW")) Keyboard.press(KEY_RIGHT_ARROW);
  else if (b.equals("DELETE")) Keyboard.press(KEY_DELETE);
  else if (b.equals("PAGEUP")) Keyboard.press(KEY_PAGE_UP);
  else if (b.equals("PAGEDOWN")) Keyboard.press(KEY_PAGE_DOWN);
  else if (b.equals("HOME")) Keyboard.press(KEY_HOME);
  else if (b.equals("ESC")) Keyboard.press(KEY_ESC);
  else if (b.equals("BACKSPACE")) Keyboard.press(KEY_BACKSPACE);
  else if (b.equals("INSERT")) Keyboard.press(KEY_INSERT);
  else if (b.equals("TAB")) Keyboard.press(KEY_TAB);
  else if (b.equals("END")) Keyboard.press(KEY_END);
  else if (b.equals("CAPSLOCK")) Keyboard.press(KEY_CAPS_LOCK);
  else if (b.equals("F1")) Keyboard.press(KEY_F1);
  else if (b.equals("F2")) Keyboard.press(KEY_F2);
  else if (b.equals("F3")) Keyboard.press(KEY_F3);
  else if (b.equals("F4")) Keyboard.press(KEY_F4);
  else if (b.equals("F5")) Keyboard.press(KEY_F5);
  else if (b.equals("F6")) Keyboard.press(KEY_F6);
  else if (b.equals("F7")) Keyboard.press(KEY_F7);
  else if (b.equals("F8")) Keyboard.press(KEY_F8);
  else if (b.equals("F9")) Keyboard.press(KEY_F9);
  else if (b.equals("F10")) Keyboard.press(KEY_F10);
  else if (b.equals("F11")) Keyboard.press(KEY_F11);
  else if (b.equals("F12")) Keyboard.press(KEY_F12);
  else if (b.equals("SPACE")) Keyboard.press(' ');
  //else Serial.println("not found :'"+b+"'("+String(b.length())+")");
}

void setup() {
 
  Serial.begin(BAUD_RATE);
  ExternSerial.begin(BAUD_RATE);

  pinMode(13,OUTPUT);
  digitalWrite(13,HIGH);

  Keyboard.begin();
}

void loop() {
  if(ExternSerial.available()) {
    bufferStr = ExternSerial.readStringUntil("END");
    Serial.println(bufferStr);
  }
 
  if(bufferStr.length() > 0){
    
    bufferStr.replace("\r","\n");
    bufferStr.replace("\n\n","\n");
    
    while(bufferStr.length() > 0){
      int latest_return = bufferStr.indexOf("\n");
      if(latest_return == -1){
        Serial.println("run: "+bufferStr);
        Line(bufferStr);
        bufferStr = "";
      } else{
        Serial.println("run: '"+bufferStr.substring(0, latest_return)+"'");
        Line(bufferStr.substring(0, latest_return));
        last=bufferStr.substring(0, latest_return);
        bufferStr = bufferStr.substring(latest_return + 1);
      }
    }
    
    bufferStr = "";
    ExternSerial.write(0x99);
    Serial.println("done");
  }
}
 

P.S: Я нуб. В коде может быть пара ошибок, так как я пытался исправить другую ошибку компиляции (и вроди бы исправил). Код взял отсюда: https://github.com/spacehuhn/wifi_ducky/blob/master/arduino_wifi_duck/ar...

DIYMan
DIYMan аватар
Offline
Зарегистрирован: 23.11.2015

Какие ошибки выдаёт компилятор? И да - вставляйте код правильно: http://arduino.ru/forum/obshchii/vstavka-programmnogo-koda-v-temukommentarii

CoolBoy
Offline
Зарегистрирован: 11.01.2018

Простите, я новичок. А компилятор никаких ошибок не выдаёт. Просто застывает на стадии компилирования и всё

wdrakula
wdrakula аватар
Offline
Зарегистрирован: 15.03.2016

Это он от восторга замирает...

CoolBoy
Offline
Зарегистрирован: 11.01.2018

wdrakula пишет:
Это он от восторга замирает...

Чему это он так радуется?

dimin21590
dimin21590 аватар
Offline
Зарегистрирован: 26.10.2016

Ну можна попробовать переустановиыть IDE или же скомпилировать на другом ПК...

dimin21590
dimin21590 аватар
Offline
Зарегистрирован: 26.10.2016

Ну вот я скомпилировал... Почти он выдал ошибку, и то не одну:











D:\Arduino\arduino-builder -dump-prefs -logger=machine -hardware D:\Arduino\hardware -hardware C:\Users\dima\AppData\Local\Arduino15\packages -tools D:\Arduino\tools-builder -tools D:\Arduino\hardware\tools\avr -tools C:\Users\dima\AppData\Local\Arduino15\packages -built-in-libraries D:\Arduino\libraries -libraries C:\Users\dima\Documents\Arduino\libraries -fqbn=arduino:avr:leonardo -ide-version=10803 -build-path C:\Users\dima\AppData\Local\Temp\arduino_build_72408 -warnings=none -build-cache C:\Users\dima\AppData\Local\Temp\arduino_cache_437950 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Users\dima\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.1.1 -prefs=runtime.tools.avrdude.path=C:\Users\dima\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino9 -prefs=runtime.tools.avr-gcc.path=C:\Users\dima\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2 -verbose C:\Users\dima\Desktop\sketch_jan11a\sketch_jan11a.ino
D:\Arduino\arduino-builder -compile -logger=machine -hardware D:\Arduino\hardware -hardware C:\Users\dima\AppData\Local\Arduino15\packages -tools D:\Arduino\tools-builder -tools D:\Arduino\hardware\tools\avr -tools C:\Users\dima\AppData\Local\Arduino15\packages -built-in-libraries D:\Arduino\libraries -libraries C:\Users\dima\Documents\Arduino\libraries -fqbn=arduino:avr:leonardo -ide-version=10803 -build-path C:\Users\dima\AppData\Local\Temp\arduino_build_72408 -warnings=none -build-cache C:\Users\dima\AppData\Local\Temp\arduino_cache_437950 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Users\dima\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.1.1 -prefs=runtime.tools.avrdude.path=C:\Users\dima\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino9 -prefs=runtime.tools.avr-gcc.path=C:\Users\dima\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2 -verbose C:\Users\dima\Desktop\sketch_jan11a\sketch_jan11a.ino
Using board 'leonardo' from platform in folder: C:\Users\dima\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20
Using core 'arduino' from platform in folder: C:\Users\dima\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20
Warning: Board Espressif:ESP8266:esp8266 doesn't define a 'build.board' preference. Auto-set to: ESP8266_ESP8266
Warning: Board arduino:avr:atmega8noxtalfast doesn't define a 'build.board' preference. Auto-set to: AVR_ATMEGA8NOXTALFAST
Warning: Board arduino:avr:atmega8optiboot doesn't define a 'build.board' preference. Auto-set to: AVR_ATMEGA8OPTIBOOT
Warning: Board breadboard:avr:atmega8optiboot doesn't define a 'build.board' preference. Auto-set to: AVR_ATMEGA8OPTIBOOT
Warning: Board breadboard:avr:atmega328bb doesn't define a 'build.board' preference. Auto-set to: AVR_ATMEGA328BB
Warning: Board breadboard:avr:atmega8noxtalfast doesn't define a 'build.board' preference. Auto-set to: AVR_ATMEGA8NOXTALFAST
Змінились налаштування збірки, все має бути перезібрано
Detecting libraries used...
"C:\Users\dima\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10803 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR  -DUSB_VID=0x2341 -DUSB_PID=0x8036 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="Arduino Leonardo"' "-IC:\Users\dima\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\cores\arduino" "-IC:\Users\dima\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\variants\leonardo" "C:\Users\dima\AppData\Local\Temp\arduino_build_72408\sketch\sketch_jan11a.ino.cpp" -o "nul"
Generating function prototypes...
"C:\Users\dima\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10803 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR  -DUSB_VID=0x2341 -DUSB_PID=0x8036 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="Arduino Leonardo"' "-IC:\Users\dima\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\cores\arduino" "-IC:\Users\dima\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\variants\leonardo" "C:\Users\dima\AppData\Local\Temp\arduino_build_72408\sketch\sketch_jan11a.ino.cpp" -o "C:\Users\dima\AppData\Local\Temp\arduino_build_72408\preproc\ctags_target_for_gcc_minus_e.cpp"
"D:\Arduino\tools-builder\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\dima\AppData\Local\Temp\arduino_build_72408\preproc\ctags_target_for_gcc_minus_e.cpp"
Компілювання...
"C:\Users\dima\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10803 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR  -DUSB_VID=0x2341 -DUSB_PID=0x8036 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="Arduino Leonardo"' "-IC:\Users\dima\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\cores\arduino" "-IC:\Users\dima\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\variants\leonardo" "C:\Users\dima\AppData\Local\Temp\arduino_build_72408\sketch\sketch_jan11a.ino.cpp" -o "C:\Users\dima\AppData\Local\Temp\arduino_build_72408\sketch\sketch_jan11a.ino.cpp.o"
sketch_jan11a:5: error: cannot convert 'const char*' to 'String*' in initialization

 String * bufferStr = "";

                      ^

C:\Users\dima\Desktop\sketch_jan11a\sketch_jan11a.ino: In function 'void Line(String)':

sketch_jan11a:15: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
     for(int i=firstSpace+1;i<_line.length();i++) Keyboard.write(_line[i]);

                                                  ^

sketch_jan11a:47: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
   Keyboard.releaseAll();

   ^

C:\Users\dima\Desktop\sketch_jan11a\sketch_jan11a.ino: In function 'void Press(String)':

sketch_jan11a:52: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
   if(b.length() == 1) Keyboard.press(char(b[0]));

                       ^

sketch_jan11a:53: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
   else if (b.equals("ENTER")) Keyboard.press(KEY_RETURN);

                               ^

sketch_jan11a:53: error: 'KEY_RETURN' was not declared in this scope

   else if (b.equals("ENTER")) Keyboard.press(KEY_RETURN);

                                              ^

sketch_jan11a:54: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
   else if (b.equals("CTRL")) Keyboard.press(KEY_LEFT_CTRL);

                              ^

sketch_jan11a:54: error: 'KEY_LEFT_CTRL' was not declared in this scope

   else if (b.equals("CTRL")) Keyboard.press(KEY_LEFT_CTRL);

                                             ^

sketch_jan11a:55: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
   else if (b.equals("SHIFT")) Keyboard.press(KEY_LEFT_SHIFT);

                               ^

sketch_jan11a:55: error: 'KEY_LEFT_SHIFT' was not declared in this scope

   else if (b.equals("SHIFT")) Keyboard.press(KEY_LEFT_SHIFT);

                                              ^

sketch_jan11a:56: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
   else if (b.equals("ALT")) Keyboard.press(KEY_LEFT_ALT);

                             ^

sketch_jan11a:56: error: 'KEY_LEFT_ALT' was not declared in this scope

   else if (b.equals("ALT")) Keyboard.press(KEY_LEFT_ALT);

                                            ^

sketch_jan11a:57: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
   else if (b.equals("GUI")) Keyboard.press(KEY_LEFT_GUI);

                             ^

sketch_jan11a:57: error: 'KEY_LEFT_GUI' was not declared in this scope

   else if (b.equals("GUI")) Keyboard.press(KEY_LEFT_GUI);

                                            ^

sketch_jan11a:58: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
   else if (b.equals("UP") || b.equals("UPARROW")) Keyboard.press(KEY_UP_ARROW);

                                                   ^

sketch_jan11a:58: error: 'KEY_UP_ARROW' was not declared in this scope

   else if (b.equals("UP") || b.equals("UPARROW")) Keyboard.press(KEY_UP_ARROW);

                                                                  ^

sketch_jan11a:59: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
   else if (b.equals("DOWN") || b.equals("DOWNARROW")) Keyboard.press(KEY_DOWN_ARROW);

                                                       ^

sketch_jan11a:59: error: 'KEY_DOWN_ARROW' was not declared in this scope

   else if (b.equals("DOWN") || b.equals("DOWNARROW")) Keyboard.press(KEY_DOWN_ARROW);

                                                                      ^

sketch_jan11a:60: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
   else if (b.equals("LEFT") || b.equals("LEFTARROW")) Keyboard.press(KEY_LEFT_ARROW);

                                                       ^

sketch_jan11a:60: error: 'KEY_LEFT_ARROW' was not declared in this scope

   else if (b.equals("LEFT") || b.equals("LEFTARROW")) Keyboard.press(KEY_LEFT_ARROW);

                                                                      ^

sketch_jan11a:61: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
   else if (b.equals("RIGHT") || b.equals("RIGHTARROW")) Keyboard.press(KEY_RIGHT_ARROW);

                                                         ^

sketch_jan11a:61: error: 'KEY_RIGHT_ARROW' was not declared in this scope

   else if (b.equals("RIGHT") || b.equals("RIGHTARROW")) Keyboard.press(KEY_RIGHT_ARROW);

                                                                        ^

sketch_jan11a:62: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
   else if (b.equals("DELETE")) Keyboard.press(KEY_DELETE);

                                ^

sketch_jan11a:62: error: 'KEY_DELETE' was not declared in this scope

   else if (b.equals("DELETE")) Keyboard.press(KEY_DELETE);

                                               ^

sketch_jan11a:63: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
   else if (b.equals("PAGEUP")) Keyboard.press(KEY_PAGE_UP);

                                ^

sketch_jan11a:63: error: 'KEY_PAGE_UP' was not declared in this scope

   else if (b.equals("PAGEUP")) Keyboard.press(KEY_PAGE_UP);

                                               ^

sketch_jan11a:64: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
   else if (b.equals("PAGEDOWN")) Keyboard.press(KEY_PAGE_DOWN);

                                  ^

sketch_jan11a:64: error: 'KEY_PAGE_DOWN' was not declared in this scope

   else if (b.equals("PAGEDOWN")) Keyboard.press(KEY_PAGE_DOWN);

                                                 ^

sketch_jan11a:65: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
   else if (b.equals("HOME")) Keyboard.press(KEY_HOME);

                              ^

sketch_jan11a:65: error: 'KEY_HOME' was not declared in this scope

   else if (b.equals("HOME")) Keyboard.press(KEY_HOME);

                                             ^

sketch_jan11a:66: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
   else if (b.equals("ESC")) Keyboard.press(KEY_ESC);

                             ^

sketch_jan11a:66: error: 'KEY_ESC' was not declared in this scope

   else if (b.equals("ESC")) Keyboard.press(KEY_ESC);

                                            ^

sketch_jan11a:67: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
   else if (b.equals("BACKSPACE")) Keyboard.press(KEY_BACKSPACE);

                                   ^

sketch_jan11a:67: error: 'KEY_BACKSPACE' was not declared in this scope

   else if (b.equals("BACKSPACE")) Keyboard.press(KEY_BACKSPACE);

                                                  ^

sketch_jan11a:68: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
   else if (b.equals("INSERT")) Keyboard.press(KEY_INSERT);

                                ^

sketch_jan11a:68: error: 'KEY_INSERT' was not declared in this scope

   else if (b.equals("INSERT")) Keyboard.press(KEY_INSERT);

                                               ^

sketch_jan11a:69: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
   else if (b.equals("TAB")) Keyboard.press(KEY_TAB);

                             ^

sketch_jan11a:69: error: 'KEY_TAB' was not declared in this scope

   else if (b.equals("TAB")) Keyboard.press(KEY_TAB);

                                            ^

sketch_jan11a:70: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
   else if (b.equals("END")) Keyboard.press(KEY_END);

                             ^

sketch_jan11a:70: error: 'KEY_END' was not declared in this scope

   else if (b.equals("END")) Keyboard.press(KEY_END);

                                            ^

sketch_jan11a:71: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
   else if (b.equals("CAPSLOCK")) Keyboard.press(KEY_CAPS_LOCK);

                                  ^

sketch_jan11a:71: error: 'KEY_CAPS_LOCK' was not declared in this scope

   else if (b.equals("CAPSLOCK")) Keyboard.press(KEY_CAPS_LOCK);

                                                 ^

sketch_jan11a:72: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
   else if (b.equals("F1")) Keyboard.press(KEY_F1);

                            ^

sketch_jan11a:72: error: 'KEY_F1' was not declared in this scope

   else if (b.equals("F1")) Keyboard.press(KEY_F1);

                                           ^

sketch_jan11a:73: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
   else if (b.equals("F2")) Keyboard.press(KEY_F2);

                            ^

sketch_jan11a:73: error: 'KEY_F2' was not declared in this scope

   else if (b.equals("F2")) Keyboard.press(KEY_F2);

                                           ^

sketch_jan11a:74: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
   else if (b.equals("F3")) Keyboard.press(KEY_F3);

                            ^

sketch_jan11a:74: error: 'KEY_F3' was not declared in this scope

   else if (b.equals("F3")) Keyboard.press(KEY_F3);

                                           ^

sketch_jan11a:75: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
   else if (b.equals("F4")) Keyboard.press(KEY_F4);

                            ^

sketch_jan11a:75: error: 'KEY_F4' was not declared in this scope

   else if (b.equals("F4")) Keyboard.press(KEY_F4);

                                           ^

sketch_jan11a:76: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
   else if (b.equals("F5")) Keyboard.press(KEY_F5);

                            ^

sketch_jan11a:76: error: 'KEY_F5' was not declared in this scope

   else if (b.equals("F5")) Keyboard.press(KEY_F5);

                                           ^

sketch_jan11a:77: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
   else if (b.equals("F6")) Keyboard.press(KEY_F6);

                            ^

sketch_jan11a:77: error: 'KEY_F6' was not declared in this scope

   else if (b.equals("F6")) Keyboard.press(KEY_F6);

                                           ^

sketch_jan11a:78: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
   else if (b.equals("F7")) Keyboard.press(KEY_F7);

                            ^

sketch_jan11a:78: error: 'KEY_F7' was not declared in this scope

   else if (b.equals("F7")) Keyboard.press(KEY_F7);

                                           ^

sketch_jan11a:79: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
   else if (b.equals("F8")) Keyboard.press(KEY_F8);

                            ^

sketch_jan11a:79: error: 'KEY_F8' was not declared in this scope

   else if (b.equals("F8")) Keyboard.press(KEY_F8);

                                           ^

sketch_jan11a:80: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
   else if (b.equals("F9")) Keyboard.press(KEY_F9);

                            ^

sketch_jan11a:80: error: 'KEY_F9' was not declared in this scope

   else if (b.equals("F9")) Keyboard.press(KEY_F9);

                                           ^

sketch_jan11a:81: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
   else if (b.equals("F10")) Keyboard.press(KEY_F10);

                             ^

sketch_jan11a:81: error: 'KEY_F10' was not declared in this scope

   else if (b.equals("F10")) Keyboard.press(KEY_F10);

                                            ^

sketch_jan11a:82: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
   else if (b.equals("F11")) Keyboard.press(KEY_F11);

                             ^

sketch_jan11a:82: error: 'KEY_F11' was not declared in this scope

   else if (b.equals("F11")) Keyboard.press(KEY_F11);

                                            ^

sketch_jan11a:83: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
   else if (b.equals("F12")) Keyboard.press(KEY_F12);

                             ^

sketch_jan11a:83: error: 'KEY_F12' was not declared in this scope

   else if (b.equals("F12")) Keyboard.press(KEY_F12);

                                            ^

sketch_jan11a:84: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
   else if (b.equals("SPACE")) Keyboard.press(' ');

                               ^

C:\Users\dima\Desktop\sketch_jan11a\sketch_jan11a.ino: In function 'void setup()':

sketch_jan11a:96: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
   Keyboard.begin();

   ^

C:\Users\dima\Desktop\sketch_jan11a\sketch_jan11a.ino: In function 'void loop()':

sketch_jan11a:101: error: cannot convert 'String' to 'String*' in assignment

     bufferStr = ExternSerial.readStringUntil("END");

               ^

sketch_jan11a:102: error: call of overloaded 'println(String*&)' is ambiguous

     Serial.println(bufferStr);

                             ^

C:\Users\dima\Desktop\sketch_jan11a\sketch_jan11a.ino:102:29: note: candidates are:

In file included from C:\Users\dima\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\cores\arduino/Stream.h:26:0,

                 from C:\Users\dima\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\cores\arduino/HardwareSerial.h:29,

                 from C:\Users\dima\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\cores\arduino/Arduino.h:232,

                 from C:\Users\dima\AppData\Local\Temp\arduino_build_72408\sketch\sketch_jan11a.ino.cpp:1:

C:\Users\dima\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\cores\arduino/Print.h:80:12: note: size_t Print::println(char) <near match>

     size_t println(char);

            ^

C:\Users\dima\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\cores\arduino/Print.h:80:12: note:   no known conversion for argument 1 from 'String*' to 'char'

C:\Users\dima\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\cores\arduino/Print.h:81:12: note: size_t Print::println(unsigned char, int) <near match>

     size_t println(unsigned char, int = DEC);

            ^

C:\Users\dima\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\cores\arduino/Print.h:81:12: note:   no known conversion for argument 1 from 'String*' to 'unsigned char'

C:\Users\dima\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\cores\arduino/Print.h:82:12: note: size_t Print::println(int, int) <near match>

     size_t println(int, int = DEC);

            ^

C:\Users\dima\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\cores\arduino/Print.h:82:12: note:   no known conversion for argument 1 from 'String*' to 'int'

C:\Users\dima\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\cores\arduino/Print.h:83:12: note: size_t Print::println(unsigned int, int) <near match>

     size_t println(unsigned int, int = DEC);

            ^

C:\Users\dima\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\cores\arduino/Print.h:83:12: note:   no known conversion for argument 1 from 'String*' to 'unsigned int'

C:\Users\dima\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\cores\arduino/Print.h:84:12: note: size_t Print::println(long int, int) <near match>

     size_t println(long, int = DEC);

            ^

C:\Users\dima\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\cores\arduino/Print.h:84:12: note:   no known conversion for argument 1 from 'String*' to 'long int'

C:\Users\dima\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\cores\arduino/Print.h:85:12: note: size_t Print::println(long unsigned int, int) <near match>

     size_t println(unsigned long, int = DEC);

            ^

C:\Users\dima\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\cores\arduino/Print.h:85:12: note:   no known conversion for argument 1 from 'String*' to 'long unsigned int'

sketch_jan11a:105: error: request for member 'length' in 'bufferStr', which is of pointer type 'String*' (maybe you meant to use '->' ?)

   if(bufferStr.length() > 0){

                ^

sketch_jan11a:107: error: request for member 'replace' in 'bufferStr', which is of pointer type 'String*' (maybe you meant to use '->' ?)

     bufferStr.replace("\r","\n");

               ^

sketch_jan11a:108: error: request for member 'replace' in 'bufferStr', which is of pointer type 'String*' (maybe you meant to use '->' ?)

     bufferStr.replace("\n\n","\n");

               ^

sketch_jan11a:110: error: request for member 'length' in 'bufferStr', which is of pointer type 'String*' (maybe you meant to use '->' ?)

     while(bufferStr.length() > 0){

                     ^

sketch_jan11a:111: error: request for member 'indexOf' in 'bufferStr', which is of pointer type 'String*' (maybe you meant to use '->' ?)

       int latest_return = bufferStr.indexOf("\n");

                                     ^

sketch_jan11a:113: error: invalid operands of types 'const char [6]' and 'String*' to binary 'operator+'

         Serial.println("run: "+bufferStr);

                                ^

sketch_jan11a:114: error: could not convert 'bufferStr' from 'String*' to 'String'

         Line(bufferStr);

                       ^

sketch_jan11a:115: error: cannot convert 'const char [1]' to 'String*' in assignment

         bufferStr = "";

                   ^

sketch_jan11a:117: error: request for member 'substring' in 'bufferStr', which is of pointer type 'String*' (maybe you meant to use '->' ?)

         Serial.println("run: '"+bufferStr.substring(0, latest_return)+"'");

                                           ^

sketch_jan11a:118: error: request for member 'substring' in 'bufferStr', which is of pointer type 'String*' (maybe you meant to use '->' ?)

         Line(bufferStr.substring(0, latest_return));

                        ^

sketch_jan11a:119: error: request for member 'substring' in 'bufferStr', which is of pointer type 'String*' (maybe you meant to use '->' ?)

         last=bufferStr.substring(0, latest_return);

                        ^

sketch_jan11a:120: error: request for member 'substring' in 'bufferStr', which is of pointer type 'String*' (maybe you meant to use '->' ?)

         bufferStr = bufferStr.substring(latest_return + 1);

                               ^

sketch_jan11a:124: error: cannot convert 'const char [1]' to 'String*' in assignment

     bufferStr = "";

               ^

exit status 1
cannot convert 'const char*' to 'String*' in initialization

 

wdrakula
wdrakula аватар
Offline
Зарегистрирован: 15.03.2016

dimin21590 пишет:

Ну можна попробовать переустановиыть IDE или же скомпилировать на другом ПК...


А Скайнет в итоге не выйдет? Ну после того, как в промикро Serial1 найдет?

CoolBoy
Offline
Зарегистрирован: 11.01.2018

Забыл сказать, то что у меня старая версия IDE, потому что новая глючила, может в этом проблема?

b707
Offline
Зарегистрирован: 26.05.2017

CoolBoy пишет:

Забыл сказать, то что у меня старая версия IDE, потому что новая глючила, может в этом проблема?

"Не обманывай себя. Маша!" (с)

В сообщении #6 тебе любезно скомпилировали твое поделие - компилятор выдал ошибок на три страницы.

CoolBoy
Offline
Зарегистрирован: 11.01.2018

b707 пишет:

CoolBoy пишет:

Забыл сказать, то что у меня старая версия IDE, потому что новая глючила, может в этом проблема?

"Не обманывай себя. Маша!" (с)

В сообщении #6 тебе любезно скомпилировали твое поделие - компилятор выдал ошибок на три страницы.

Не моё. Я его в инете нашёл.

b707
Offline
Зарегистрирован: 26.05.2017

CoolBoy пишет:

Не моё. Я его в инете нашёл.

Лучше свое пиши, а не чужое по инетам тырь.

Суть остается прежней - в скетче куча ошибок и как ИДЕ не меняй - компилироваться он не будет.