motor shield code does not compile on Uno

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
defwheezer
 
Posts: 7
Joined: Mon Nov 22, 2010 2:10 pm

motor shield code does not compile on Uno

Post by defwheezer »

I have a mshield and am trying to get it to work with an Uno. I have downloaded and installed the example files but when I try to compile the Stepper_test.pde (saved and renamed to Stepper_mshiled.cpp) I get the following error(s):

Code: Select all

Stepper_mshield.cpp.o: In function `__static_initialization_and_destruction_0':
C:\Users\cb\AppData\Local\Temp\build6747454765270017349.tmp/Stepper_mshield.cpp:16: undefined reference to `AF_Stepper::AF_Stepper(unsigned int, unsigned char)'
Stepper_mshield.cpp.o: In function `loop':
C:\Users\cb\AppData\Local\Temp\build6747454765270017349.tmp/Stepper_mshield.cpp:27: undefined reference to `AF_Stepper::step(unsigned int, unsigned char, unsigned char)'
C:\Users\cb\AppData\Local\Temp\build6747454765270017349.tmp/Stepper_mshield.cpp:28: undefined reference to `AF_Stepper::step(unsigned int, unsigned char, unsigned char)'
C:\Users\cb\AppData\Local\Temp\build6747454765270017349.tmp/Stepper_mshield.cpp:31: undefined reference to `AF_Stepper::step(unsigned int, unsigned char, unsigned char)'
C:\Users\cb\AppData\Local\Temp\build6747454765270017349.tmp/Stepper_mshield.cpp:32: undefined reference to `AF_Stepper::step(unsigned int, unsigned char, unsigned char)'
C:\Users\cb\AppData\Local\Temp\build6747454765270017349.tmp/Stepper_mshield.cpp:35: undefined reference to `AF_Stepper::step(unsigned int, unsigned char, unsigned char)'
Stepper_mshield.cpp.o:C:\Users\cb\AppData\Local\Temp\build6747454765270017349.tmp/Stepper_mshield.cpp:36: more undefined references to `AF_Stepper::step(unsigned int, unsigned char, unsigned char)' follow
Stepper_mshield.cpp.o: In function `setup':
C:\Users\cb\AppData\Local\Temp\build6747454765270017349.tmp/Stepper_mshield.cpp:22: undefined reference to `AF_Stepper::setSpeed(unsigned int)'
Sorry if this is a stupid issue, but I am noob to arduino.

Thanks,

Carl

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: motor shield code does not compile on Uno

Post by adafruit_support_bill »

Scroll to the top of the output window and get the first few lines of the error output. They are usually the most relevant.

From the looks of what you have posted, I suspect that the AF_Motor library is not installed in the right location. Follow the instructions here: http://www.ladyada.net/library/arduino/libraries.html

User avatar
defwheezer
 
Posts: 7
Joined: Mon Nov 22, 2010 2:10 pm

Re: motor shield code does not compile on Uno

Post by defwheezer »

You were correct- following the detailed instructions I realized I had the wrong directory structure in the Library for the mShield, all fixed now and the shield is working perfectly!

Thanks

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”