Step by Step with accelstepper step()??

4,441 views
Skip to first unread message

Edgar Martinez

unread,
Mar 5, 2012, 12:57:39 PM3/5/12
to accelstepper
Hi everybody
I want to go step by step with the accelstepper library but i dont
know how can i do that
anybody have worked with these function?, i dont understand very well
how can put these function in my code:




===============================================================================
to execute a step on a stepper drover (ie where pins == 1). Only
called when a new step is required. Subclasses may override to
implement new stepping interfaces. The default sets or clears the
outputs of Step pin1 to step, and sets the output of _pin2 to the
desired direction. The Step pin (_pin1) is pulsed for 1 microsecond
which is the minimum STEP pulse width for the 3967 driver.

Parameters:
[in] step The current step phase number (0 to 7)

=================================================================================
please a need a little help.
thanks.

Sandy Noble

unread,
Mar 5, 2012, 1:23:08 PM3/5/12
to accels...@googlegroups.com
Hi Edgar, you'd do something like

// declare your motor
AccelStepper motor = new AccelStepper(4, 1,2,3,4);

// set the target number of steps to move
motor.move(1); // this states to move one step ahead

// and then run until it gets there
motor.runToPosition();


Does that help? The step() method is wrapped by these other methods,
so you don't need to step manually. However, if you're only moving
one step at a time anyway, you might find the regular arduino Stepper
library is all you need.


Sandy Noble

--
Sandy Noble

Eddiie

unread,
May 16, 2014, 3:13:38 PM5/16/14
to accels...@googlegroups.com
It helped me.  Thank you!  ;)

Reply all
Reply to author
Forward
0 new messages