Calling stop on a multiStepper instance

163 views
Skip to first unread message

Donovan Buck

unread,
Jun 2, 2017, 2:20:40 PM6/2/17
to accelstepper
Something like "void MultiStepper::stop( )" would be handy. Alternately if the members of a multiStepper instance were public I could just call stop on each member.

I've considered creating a subclass and tracking/exposing the members of the group there, but that would add complexity and size to a library that really needs to remain small.

Is there already a way to stop all the members of a group (or know the members of a group and work with those) that I'm just not seeing?

Mike McCauley

unread,
Jun 4, 2017, 9:19:28 PM6/4/17
to accels...@googlegroups.com, Donovan Buck
Hello,

so stop() really only makes sense in the context of acceleration (see the
documentation).

Multistepper does not support acceleration, so to stop all the motors, just
stop calling run().

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

Donovan Buck

unread,
Jun 5, 2017, 9:09:35 AM6/5/17
to accelstepper, don...@donovan.bz
Okay, that makes sense.

Thanks

Donovan Buck

unread,
Jun 5, 2017, 8:53:37 PM6/5/17
to accelstepper, don...@donovan.bz
Follow up question...

Could I interest you in a multiStepper.getSteppers method?

Here's my use case... I am working on a new version of the stepper motor library for configurableFirmata (we are going to be using accelStepper in that). Since firmata is just a communications protocol I don't want to include any state management there. We could certainly put the burden of tracking which steppers are members of a multiStepper group onto the host server but then anytime we wanted to do something with each member (i.e. get positions) we would be generating a lot of messages between the host server and the arduino.

A getSteppers method would allow me to easily call accelStepper methods on every member of a multiStepper group (i.e. enableOutputs, getCurrentPosition, zero, etc.)

Thanks again for your time and for making accelStepper.

Donovan

On Monday, June 5, 2017 at 8:09:35 AM UTC-5, Donovan Buck wrote:
Okay, that makes sense.

Thanks

Mike McCauley

unread,
Jun 5, 2017, 9:07:42 PM6/5/17
to accels...@googlegroups.com
Hello,

yes, but didnt you pass the steppers to MultiStepper::addStepper? Surely you
know how many there are and what their pointers are?

Cheers.

On Monday, 5 June 2017 5:53:37 PM AEST Donovan Buck wrote:
> Follow up question...
>
> Could I interest you in a multiStepper.getSteppers method?
>
> Here's my use case... I am working on a new version of the stepper motor
> library for configurableFirmata (we are going to be using accelStepper in
> that). Since firmata
> <https://github.com/firmata/arduino/blob/master/readme.md> is just a
> communications protocol I don't want to include any state management there.
> We could certainly put the burden of tracking which steppers are members of
> a multiStepper group onto the host server but then anytime we wanted to do
> something with each member (i.e. get positions) we would be generating a
> lot of messages between the host server and the arduino.
>
> A getSteppers method would allow me to easily call accelStepper methods on
> every member of a multiStepper group (i.e. enableOutputs,
> getCurrentPosition, zero, etc.)
>
> Thanks again for your time and for making accelStepper.
>
> Donovan
>
> On Monday, June 5, 2017 at 8:09:35 AM UTC-5, Donovan Buck wrote:
> > Okay, that makes sense.
> >
> > Thanks


Donovan Buck

unread,
Jun 6, 2017, 10:09:00 AM6/6/17
to accelstepper
I did indeed, and that's an option. I am just trying to stick with the convention of firmata being a messaging protocol and not responsible for managing state while at the same time removing the need for multiple calls from the host server to the Arduino (which could be made via wi-fi, serial, or bouncing off relay servers in the cloud somewhere).

-D
Reply all
Reply to author
Forward
0 new messages