Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

AFMotor Library Problems
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

AFMotor Library Problems

by rmadams on Sat Mar 01, 2008 10:50 pm

I am having problems with my new (and very cool!) Motor Shield v1.0. I installed the AFMotor library as instructed in arduino/hardware/libraries, but I get a huge run of errors when I try to compile the sample code from the instructions page. I am running on a recent Ubuntu Linux system, if that makes any difference. Here is a sample of the errors I am getting. Can anyone help me make sense of this? I just tried the same thing on a MacBook, and I get the same result. I am starting to suspect I am doing something stupid...

Thanks!

Code: Select all | TOGGLE FULL SIZE
In file included from /home/rmadams/Desktop/arduino-0010/hardware/cores/arduino/WProgram.h:8,
                 from AFMotor.cpp:2:
/home/rmadams/Desktop/arduino-0010/hardware/cores/arduino/wiring.h:60:1: warning: "abs" redefined
In file included from /home/rmadams/Desktop/arduino-0010/hardware/cores/arduino/WProgram.h:1,
                 from AFMotor.cpp:2:
/usr/lib/gcc/avr/3.4.3/../../../../avr/include/stdlib.h:116:1: warning: this is the location of the previous definition
AFMotor.cpp: In constructor `AF_DCMotor::AF_DCMotor(uint8_t, uint8_t)':
AFMotor.cpp:60: error: `TCCR2A' undeclared (first use this function)
AFMotor.cpp:60: error: (Each undeclared identifier is reported only once for each function it appears in.)
AFMotor.cpp:60: error: `COM2A1' undeclared (first use this function)
AFMotor.cpp:61: error: `TCCR2B' undeclared (first use this function)
AFMotor.cpp:62: error: `OCR2A' undeclared (first use this function)
AFMotor.cpp:70: error: `COM2B1' undeclared (first use this function)
AFMotor.cpp:80: error: `TCCR0A' undeclared (first use this function)
AFMotor.cpp:80: error: `COM0B1' undeclared (first use this function)
AFMotor.cpp:80: error: `WGM00' undeclared (first use this function)
AFMotor.cpp:80: error: `WGM01' undeclared (first use this function)
AFMotor.cpp:81: error: `TCCR0B' undeclared (first use this function)
AFMotor.cpp:82: error: `OCR0B' undeclared (first use this function)
AFMotor.cpp:90: error: `COM0A1' undeclared (first use this function)
AFMotor.cpp:92: error: `OCR0A' undeclared (first use this function)
AFMotor.cpp: In member function `void AF_DCMotor::setSpeed(uint8_t)':
AFMotor.cpp:135: error: `OCR2A' undeclared (first use this function)
AFMotor.cpp:137: error: `OCR2B' undeclared (first use this function)
AFMotor.cpp:139: error: `OCR0B' undeclared (first use this function)
AFMotor.cpp:141: error: `OCR0A' undeclared (first use this function)
AFMotor.cpp: In constructor `AF_Stepper::AF_Stepper(uint8_t, uint8_t)':
AFMotor.cpp:161: error: `TCCR2B' undeclared (first use this function)
AFMotor.cpp:162: error: `OCR2A' undeclared (first use this function)
AFMotor.cpp:175: error: `TCCR0B' undeclared (first use this function)
AFMotor.cpp:176: error: `OCR0A' undeclared (first use this function)
o(.text+0x1e): In function `setup':
undefined reference to `AF_DCMotor::setSpeed(unsigned char)'o(.text+0x32): In function `loop':
o(.text+0x4e):/tmp/build20265.tmp/Temporary_3431_5962.cpp:19: undefined reference to `AF_DCMotor::run(unsigned char)'
o(.text+0x6a):/tmp/build20265.tmp/Temporary_3431_5962.cpp:23: undefined reference to `AF_DCMotor::run(unsigned char)'
o(.text+0x90): In function `global constructors keyed to motor':
Couldn't determine program size:

rmadams
 
Posts: 4
Joined: Sat Mar 01, 2008 10:40 pm

by adafruit on Thu Mar 06, 2008 6:28 pm

are you using an NG or Diecimila Arduino?

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Arduino type

by rmadams on Thu Mar 06, 2008 8:43 pm

Thanks for the response! It is a "NG." Should I try with a Diecimila?

rmadams
 
Posts: 4
Joined: Sat Mar 01, 2008 10:40 pm

by adafruit on Thu Mar 06, 2008 11:23 pm

i have to track down an NG to test it. if you could find a diecimila, you'll find everything works a lot better :)

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Diecimila Works

by rmadams on Sun Mar 09, 2008 10:44 am

I located a diecimila board, and it works perfectly. Must be a problem in the motor library compiled against the NG. Anyone working on porting it to the NG/ATMEGA128 that you know of?

rmadams
 
Posts: 4
Joined: Sat Mar 01, 2008 10:40 pm

by adafruit on Sun Mar 09, 2008 1:43 pm

ill put 'porting to NG' on my todo list, it shouldnt be too hard.

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Please be positive and constructive with your questions and comments.