HALF4WIRE is not a member of AccelStepper

924 views
Skip to first unread message

Scott Murchison

unread,
Sep 12, 2013, 9:28:13 PM9/12/13
to accels...@googlegroups.com
I recently had this problem, so I downloaded and installed the 1.37 version of the library. The error went away and my sketch was working, but now it is back and I don't know why. I placed the AccelStepper directory under my libraries folder. It should work now. Any ideas?

AccelStepper.h is the 9/9/2013 version


Scott

here is a small part of the code;


#include <AccelStepper.h>
AccelStepper motor(AccelStepper::HALF4WIRE, 8, 9, 12, 13);
const int motorPin1 = 8;
const int motorPin2 = 9;
const int motorPin3 = 12;
const int motorPin4 = 13;

Mike McCauley

unread,
Sep 15, 2013, 2:39:00 AM9/15/13
to accels...@googlegroups.com
Hello,

your sample code compiles here fine.

I suspect that you have a problem with your installation of AccelStepper into
your library. Suggest yyou delete any existing versions and them make sure you
install the latest version.

Cheers.
--
Mike McCauley mi...@airspayce.com
Airspayce Pty Ltd 9 Bulbul Place Currumbin Waters QLD 4223 Australia
http://www.airspayce.com
Phone +61 7 5598-7474 Fax +61 7 5598-7070

Adam Okon

unread,
Sep 30, 2013, 1:19:59 PM9/30/13
to accels...@googlegroups.com
Can we use Adafruit Motor Shield V2 for Arduino with accelstepper?

http://learn.adafruit.com/adafruit-motor-shield-v2-for-arduino/overview

It is I2C but I think code can be portable.

Adam

Mike McCauley

unread,
Oct 2, 2013, 5:41:46 PM10/2/13
to accels...@googlegroups.com
Hello,

Yes, see the AFMotor_* examples included in the AccelStepper download.

Cheers.
--
Mike McCauley VK4AMM mi...@airspayce.com

Philip Pesce

unread,
Dec 14, 2013, 7:32:20 AM12/14/13
to accels...@googlegroups.com
Hi Mike,

I just tried this and am getting an error that says: "AF_Stepper" does not name a type

I am using the new Adafruit MotorShield library (for version 2 of the shield).  I believe Adafruit's old library was named "AFMotor.h".  The new library is named "Adafruit_MotorShield.h".

When I look at the "AFMotor_ConstantSpeed" example in AccelStepper, I'm seeing that it's including, what looks like, the old library ("AFMotor.h").

Do I have an old version of the AccelStepper library perhaps?  Or is there something that I'm missing entirely (which is possible seeing as I'm still a novice at this stuff).

Would appreciate your help!

Thanks,

Phil

Mike McCauley

unread,
Dec 14, 2013, 5:37:02 PM12/14/13
to accels...@googlegroups.com
Hi,

On Saturday, December 14, 2013 04:32:20 AM Philip Pesce wrote:
> Hi Mike,
>
> I just tried this and am getting an error that says: "AF_Stepper" does not
> name a type
>
> I am using the new Adafruit MotorShield library (for version 2 of the
> shield). I believe Adafruit's old library was named "AFMotor.h". The new
> library is named "Adafruit_MotorShield.h".
>
> When I look at the "AFMotor_ConstantSpeed" example in AccelStepper, I'm
> seeing that it's including, what looks like, the old library ("AFMotor.h").
>
> Do I have an old version of the AccelStepper library perhaps? Or is there
> something that I'm missing entirely (which is possible seeing as I'm still
> a novice at this stuff).
>
> Would appreciate your help!

The examples do indeed import AFMotor.h. It appears there is a later version
V2 of AFMotor that has a different main header file (which is very unhelpful of
them) but you are free to alter the example to suit this newer version.

If you are not able to do that, perhaps you should consider using V1
https://github.com/adafruit/Adafruit-Motor-Shield-library

Cheers.
Reply all
Reply to author
Forward
0 new messages