MotorShield and Arduino Due

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
titous
 
Posts: 62
Joined: Thu Jun 21, 2012 9:19 am

MotorShield and Arduino Due

Post by titous »

Hi there!

I know you haven't had time to properly test the due with the shield and thus make any changes to your library; so I was hoping to do it for you...

However I've hit a roadblock I can't figure out myself: when trying to upload a sketch that uses the AFMotor library, I get the error: "_B was not declared in this scope". It makes me think that the core Arduino functions are not being loaded properly and I'm guessing it has to do with the following lines of code found in AFMotor.cpp:

Code: Select all

#if (ARDUINO >= 100)
  #include "Arduino.h"
#else
  #if defined(__AVR__)
    #include <avr/io.h>
  #endif
  #include "WProgram.h"
#endif
Even if I get rid of the if statement

Code: Select all

  #include "Arduino.h"
I still get erros with _BV.

Any quick suggestions?

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

Re: MotorShield and Arduino Due

Post by adafruit_support_bill »

I did a bit of preliminary testing. There is quite a lot of work to be done in the library. All of the PWM timer code is processor specific and the Due is not one of the defined processors. As a result, a number of symbols are left undefined when compiling for the Due.

titous
 
Posts: 62
Joined: Thu Jun 21, 2012 9:19 am

Re: MotorShield and Arduino Due

Post by titous »

so just wait and drown my sorrows until a new library is written while i try to trudge through it? :(

i figured as such, thanks for the help, i'll keep checking for the new library if i can't figure it out in the mean time!

esnyder
 
Posts: 4
Joined: Fri Feb 01, 2013 2:22 pm

Re: MotorShield and Arduino Due

Post by esnyder »

Just in case anyone else is interested in getting this working on the Due too; my current work in progress is at https://github.com/esnyder/Adafruit-Mot ... ld-library

I have it compiling, and (kinda) running. But it doesn't actually use the frequency values you give the controller on construction. If I manage to get it in shape I'll see if the main project will merge it.

It looks to me like the Due board doesn't have "real" PWM capable pins from the SAM3 on digital pins 3, 5 or 11. My current plan is to try to use the same interrupt timer that the core arduino library uses for doing PWM on those pins so that it will honor the frequency values given.

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

Return to “Arduino Shields from Adafruit”