Arduino and Adafruit motor shield V2 problem...

조회 수: 2 (최근 30일)
Francis Zurbach
Francis Zurbach 2018년 3월 4일
Hi....I'm trying to make a Simulink Library module for the Adafruit Motorshield v2.0 with S-function builder to work with an arduino card. When i try to implement the "application" i get this error (see after this text) "undefined reference to..." and i can't understand what is wrong...Can you help me ? thanks.
C:/ProgramData/MATLAB/SupportPackages/R2017b/3P.instrset/arduinoide.instrset/arduino-1.8.1/hardware/tools/avr/bin/avr-gcc -w -Os -Wl,--gc-sections,--relax -mmcu=atmega328p -o ../adafruitmsi2d.elf adafruitmsi2d.o sfADAFMSI2C_wrapper.o wiring_pulse.S.o hooks.o WInterrupts.o wiring.o wiring_analog.o wiring_digital.o wiring_pulse.o wiring_shift.o abi.o CDC.o HardwareSerial.o HardwareSerial0.o HardwareSerial1.o HardwareSerial2.o HardwareSerial3.o PluggableUSB.o IPAddress.o new.o Print.o Stream.o Tone.o USBCore.o WMath.o WString.o MW_ArduinoHWInit.o io_wrappers.o arduinoAVRScheduler.o ert_main.o -lm sfADAFMSI2C_wrapper.o: In function `Adafruit_MotorShield::setPin(unsigned char, bool)': C:\Users\NOVAFLY-PI\Documents\MATLAB\LIBADAFRUIMSV2\adafruitmsi2d_ert_rtw/../Adafruit_MotorShield.cpp:477: undefined reference to `Adafruit_MS_PWMServoDriver::setPWM(unsigned char, unsigned int, unsigned int)' sfADAFMSI2C_wrapper.o: In function `Adafruit_MotorShield::begin(unsigned int, TwoWire*)': C:\Users\NOVAFLY-PI\Documents\MATLAB\LIBADAFRUIMSV2\adafruitmsi2d_ert_rtw/../Adafruit_MotorShield.cpp:82: undefined reference to `Adafruit_MS_PWMServoDriver::begin()' C:\Users\NOVAFLY-PI\Documents\MATLAB\LIBADAFRUIMSV2\adafruitmsi2d_ert_rtw/../Adafruit_MotorShield.cpp:84: undefined reference to `Adafruit_MS_PWMServoDriver::setPWMFreq(float)' C:\Users\NOVAFLY-PI\Documents\MATLAB\LIBADAFRUIMSV2\adafruitmsi2d_ert_rtw/../Adafruit_MotorShield.cpp:86: undefined reference to `Adafruit_MS_PWMServoDriver::setPWM(unsigned char, unsigned int, unsigned int)' sfADAFMSI2C_wrapper.o: In function `Adafruit_MotorShield::setPWM(unsigned char, unsigned int)': C:\Users\NOVAFLY-PI\Documents\MATLAB\LIBADAFRUIMSV2\adafruitmsi2d_ert_rtw/../Adafruit_MotorShield.cpp:101: undefined reference to `Adafruit_MS_PWMServoDriver::setPWM(unsigned char, unsigned int, unsigned int)' sfADAFMSI2C_wrapper.o: In function `Adafruit_MotorShield::setPin(unsigned char, bool)': C:\Users\NOVAFLY-PI\Documents\MATLAB\LIBADAFRUIMSV2\adafruitmsi2d_ert_rtw/../Adafruit_MotorShield.cpp:115: undefined reference to `Adafruit_MS_PWMServoDriver::setPWM(unsigned char, unsigned int, unsigned int)' sfADAFMSI2C_wrapper.o: In function `Adafruit_MotorShield::Adafruit_MotorShield(unsigned char)': C:\Users\NOVAFLY-PI\Documents\MATLAB\LIBADAFRUIMSV2\adafruitmsi2d_ert_rtw/../Adafruit_MotorShield.cpp:52: undefined reference to `Adafruit_MS_PWMServoDriver::Adafruit_MS_PWMServoDriver(unsigned char)' C:\Users\NOVAFLY-PI\Documents\MATLAB\LIBADAFRUIMSV2\adafruitmsi2d_ert_rtw/../Adafruit_MotorShield.cpp:54: undefined reference to `Adafruit_MS_PWMServoDriver::Adafruit_MS_PWMServoDriver(unsigned char)' collect2.exe: error: ld returned 1 exit status gmake: * [../adafruitmsi2d.elf] Error 1 C:\Users\NOVAFLY-PI\Documents\MATLAB\LIBADAFRUIMSV2\adafruitmsi2d_ert_rtw>echo The make command returned an error of 2 The make command returned an error of 2 C:\Users\NOVAFLY-PI\Documents\MATLAB\LIBADAFRUIMSV2\adafruitmsi2d_ert_rtw>An_error_occurred_during_the_call_to_make 'An_error_occurred_during_the_call_to_make' n'est pas reconnu en tant que commande interne ou externe, un programme exécutable ou un fichier de commandes. ### Creating HTML report file adafruitmsi2d_codegen_rpt.html ### Build procedure for model: 'adafruitmsi2d' aborted due to an error. Error:Error(s) encountered while building "adafruitmsi2d": ### Failed to generate all binary outputs.____

답변 (0개)

커뮤니티

더 많은 답변 보기:  Power Electronics Community

카테고리

Help CenterFile Exchange에서 Arduino Hardware에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by