Possible Accelstepper bug - or maybe I'm just missing something

289 views
Skip to first unread message

Brian Schmalz

unread,
Sep 23, 2012, 10:37:35 AM9/23/12
to accels...@googlegroups.com

If you take any of the examples that come with AccelStepper, and instead of writing

 

AccelStepper stepper;

 

For the objection creation, you write

 

AccelStepper stepper(FULL4WIRE, 1, 2, 3, 4);

 

(which, as I understand it, is the right way to specify the FULL4WIRE interface with 4 different pins) then you get

 

“ConstantSpeed:11: error: ‘FULL4WIRE’ was not declared in this scope”

 

When you try to compile. Or at least I do.  Does anybody else get that too? This is with the latest version of the library (1.19).

 

I believe the problem lies in the fact that the function prototype is

 

                AccelStepper(uint8_t interface = FULL4WIRE, uint8_t pin1 = 2, uint8_t pin2 = 3, uint8_t pin3 = 4, uint8_t pin4 = 5);

 

Rather than

 

AccelStepper(MotorInterfaceType interface = FULL4WIRE, uint8_t pin1 = 2, uint8_t pin2 = 3, uint8_t pin3 = 4, uint8_t pin4 = 5);

 

But I’m not really much of a C++ guy, so I could be totally off on this one.

 

Can anyone confirm this problem?

 

*Brian

 

Mike McCauley

unread,
Sep 23, 2012, 4:33:45 PM9/23/12
to accels...@googlegroups.com
Hi,

On Sunday, September 23, 2012 09:37:35 AM Brian Schmalz wrote:
> If you take any of the examples that come with AccelStepper, and instead of
> writing

> AccelStepper stepper;
>
> For the objection creation, you write
>
> AccelStepper stepper(FULL4WIRE, 1, 2, 3, 4);
>
> (which, as I understand it, is the right way to specify the FULL4WIRE
> interface with 4 different pins) then you get

> “ConstantSpeed:11: error: ‘FULL4WIRE’ was not declared in this scope”
>
> When you try to compile. Or at least I do. Does anybody else get that too?
> This is with the latest version of the library (1.19).

You must use:

AccelStepper stepper(AccelStepper::FULL4WIRE, 1, 2, 3, 4);

> I believe the problem lies in the fact that the function prototype is
>
> AccelStepper(uint8_t interface = FULL4WIRE, uint8_t pin1 =
> 2, uint8_t pin2 = 3, uint8_t pin3 = 4, uint8_t pin4 = 5);

> Rather than
>
> AccelStepper(MotorInterfaceType interface = FULL4WIRE, uint8_t pin1 = 2,
> uint8_t pin2 = 3, uint8_t pin3 = 4, uint8_t pin4 = 5);

> But I’m not really much of a C++ guy, so I could be totally off on this
> one.

> Can anyone confirm this problem?
>
> *Brian
>

--
Mike McCauley mi...@open.com.au
Open System Consultants Pty. Ltd
9 Bulbul Place Currumbin Waters QLD 4223 Australia http://www.open.com.au
Phone +61 7 5598-7474 Fax +61 7 5598-7070

Radiator: the most portable, flexible and configurable RADIUS server
anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald,
Platypus, Freeside, TACACS+, PAM, external, Active Directory, EAP, TLS,
TTLS, PEAP, TNC, WiMAX, RSA, Vasco, Yubikey, MOTP, HOTP, TOTP,
DIAMETER etc. Full source on Unix, Windows, MacOSX, Solaris, VMS, NetWare etc.

Mike McCauley

unread,
Sep 23, 2012, 5:06:07 PM9/23/12
to accels...@googlegroups.com
Hi again,


On Monday, September 24, 2012 06:33:45 AM Mike McCauley wrote:
> Hi,
>
> On Sunday, September 23, 2012 09:37:35 AM Brian Schmalz wrote:
> > If you take any of the examples that come with AccelStepper, and instead
> > of writing
> >
> > AccelStepper stepper;
> >
> > For the objection creation, you write
> >
> > AccelStepper stepper(FULL4WIRE, 1, 2, 3, 4);
> >
> > (which, as I understand it, is the right way to specify the FULL4WIRE
> > interface with 4 different pins) then you get
> >
> > “ConstantSpeed:11: error: ‘FULL4WIRE’ was not declared in this scope”
> >
> > When you try to compile. Or at least I do. Does anybody else get that
> > too? This is with the latest version of the library (1.19).
>
> You must use:
>
> AccelStepper stepper(AccelStepper::FULL4WIRE, 1, 2, 3, 4);

I have now updated the documentation to make this clearer.

Cheers.
Reply all
Reply to author
Forward
0 new messages