Menu

'serialEvent' was not declared in this scope

2020-07-13
2020-10-14
  • Hao Chuan Wu

    Hao Chuan Wu - 2020-07-13

    Hello, I'm using DRV8825HW203-M-MT-F-BT , and myFP2_DRV8825HW203_298 firmware,
    but arduino keeps telling me that

    serialcomms.h:614:17: error: 'serialEvent' was not declared in this scope

     serialEvent();
    

    I don't know how to fix it, can you tell me how?

    Thank you.

    Harry Wu

    Arduino: 1.8.9 (Windows 10), Board: "Arduino Nano, ATmega328P"

    C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\吳浩銓\Documents\Arduino\libraries -fqbn=arduino:avr:nano:cpu=atmega328 -vid-pid=1A86_7523 -ide-version=10809 -build-path C:\Temp\arduino_build_523333 -warnings=default -build-cache C:\Temp\arduino_cache_445551 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino14.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\吳浩銓\Desktop\Auto Focuser\firmware\myFocuserPro2 Official Arduino Firmware 298\myFP2_DRV8825HW203_298\myFP2_DRV8825HW203_298.ino
    C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\吳浩銓\Documents\Arduino\libraries -fqbn=arduino:avr:nano:cpu=atmega328 -vid-pid=1A86_7523 -ide-version=10809 -build-path C:\Temp\arduino_build_523333 -warnings=default -build-cache C:\Temp\arduino_cache_445551 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino14.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\吳浩銓\Desktop\Auto Focuser\firmware\myFocuserPro2 Official Arduino Firmware 298\myFP2_DRV8825HW203_298\myFP2_DRV8825HW203_298.ino
    Using board 'nano' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
    Using core 'arduino' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
    Detecting libraries used...
    "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs" "C:\Temp\arduino_build_523333\sketch\myFP2_DRV8825HW203_298.ino.cpp" -o nul
    "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myQueue" "C:\Temp\arduino_build_523333\sketch\myFP2_DRV8825HW203_298.ino.cpp" -o nul
    "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myQueue" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myEEPROM" "C:\Temp\arduino_build_523333\sketch\myFP2_DRV8825HW203_298.ino.cpp" -o nul
    "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myQueue" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myEEPROM" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\src" "C:\Temp\arduino_build_523333\sketch\myFP2_DRV8825HW203_298.ino.cpp" -o nul
    "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myQueue" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myEEPROM" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\src" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myOLED" "C:\Temp\arduino_build_523333\sketch\myFP2_DRV8825HW203_298.ino.cpp" -o nul
    "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myQueue" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myEEPROM" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\src" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myOLED" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\OneWire" "C:\Temp\arduino_build_523333\sketch\myFP2_DRV8825HW203_298.ino.cpp" -o nul
    "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myQueue" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myEEPROM" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\src" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myOLED" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\OneWire" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myDallasTemperature" "C:\Temp\arduino_build_523333\sketch\myFP2_DRV8825HW203_298.ino.cpp" -o nul
    Using cached library dependencies for file: C:\Temp\arduino_build_523333\sketch\myBoards.cpp
    "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myQueue" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myEEPROM" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\src" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myOLED" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\OneWire" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myDallasTemperature" "C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\src\Wire.cpp" -o nul
    "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myQueue" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myEEPROM" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\src" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myOLED" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\OneWire" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myDallasTemperature" "C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\src\utility\twi.c" -o nul
    "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myQueue" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myEEPROM" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\src" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myOLED" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\OneWire" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myDallasTemperature" "C:\Users\吳浩銓\Documents\Arduino\libraries\myOLED\mySSD1306Ascii.cpp" -o nul
    "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myQueue" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myEEPROM" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\src" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myOLED" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\OneWire" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myDallasTemperature" "C:\Users\吳浩銓\Documents\Arduino\libraries\OneWire\OneWire.cpp" -o nul
    "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myQueue" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myEEPROM" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\src" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myOLED" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\OneWire" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myDallasTemperature" "C:\Users\吳浩銓\Documents\Arduino\libraries\myDallasTemperature\myDallasTemperature.cpp" -o nul
    Generating function prototypes...
    "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myQueue" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myEEPROM" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\src" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myOLED" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\OneWire" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myDallasTemperature" "C:\Temp\arduino_build_523333\sketch\myFP2_DRV8825HW203_298.ino.cpp" -o "C:\Temp\arduino_build_523333\preproc\ctags_target_for_gcc_minus_e.cpp"
    "C:\Program Files (x86)\Arduino\tools-builder\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Temp\arduino_build_523333\preproc\ctags_target_for_gcc_minus_e.cpp"
    Compiling sketch...
    "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myQueue" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myEEPROM" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\src" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myOLED" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\OneWire" "-IC:\Users\吳浩銓\Documents\Arduino\libraries\myDallasTemperature" "C:\Temp\arduino_build_523333\sketch\myFP2_DRV8825HW203_298.ino.cpp" -o "C:\Temp\arduino_build_523333\sketch\myFP2_DRV8825HW203_298.ino.cpp.o"
    Using previously compiled file: C:\Temp\arduino_build_523333\sketch\myBoards.cpp.o
    In file included from C:\Users\吳浩銓\Desktop\Auto Focuser\firmware\myFocuserPro2 Official Arduino Firmware 298\myFP2_DRV8825HW203_298\myFP2_DRV8825HW203_298.ino:508:0:

    C:\Temp\arduino_build_523333\sketch\serialcomms.h: In function 'void serialEventRun()':

    serialcomms.h:614:17: error: 'serialEvent' was not declared in this scope

     serialEvent();
    
                 ^
    

    Using library myQueue in folder: C:\Users\吳浩銓\Documents\Arduino\libraries\myQueue (legacy)
    Using library myEEPROM in folder: C:\Users\吳浩銓\Documents\Arduino\libraries\myEEPROM (legacy)
    Using library Wire at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire
    Using library myOLED in folder: C:\Users\吳浩銓\Documents\Arduino\libraries\myOLED (legacy)
    Using library OneWire at version 2.3.3 in folder: C:\Users\吳浩銓\Documents\Arduino\libraries\OneWire
    Using library myDallasTemperature in folder: C:\Users\吳浩銓\Documents\Arduino\libraries\myDallasTemperature (legacy)
    exit status 1
    'serialEvent' was not declared in this scope

     
    • brownrb

      brownrb - 2020-10-14

      my deepest apologies for the time taken
      Your message has been stuck in the moderation queue and I never found it till now.

      This is because in the main file you had
      #define CONTROLLERISAMICRO 1

      which causes the error. If you change it to
      //#define CONTROLLERISAMICRO 1

      then it should be good

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.