Alternative to stepper Libary
hello,
i'm using stepper libary run bipolar stepper. problem when i'm runing motor in "loop" have wait until stepper finished steps before loop continues.
as in attached code, how make led blink while motor runs?
is there maybe different stepper libary oder else?
thanks response
i'm using stepper libary run bipolar stepper. problem when i'm runing motor in "loop" have wait until stepper finished steps before loop continues.
as in attached code, how make led blink while motor runs?
is there maybe different stepper libary oder else?
thanks response
code: [select]
#include <stepper.h>
const int stepsperrevolution = 200;
stepper mystepper(stepsperrevolution, 8, 9, 10, 11);
void setup() {
mystepper.setspeed(60);
pinmode(2, output);
}
void loop() {
mystepper.step(stepsperrevolution);
mystepper.step(-stepsperrevolution);
digitalwrite(2, high);
delay(100);
digitalwrite(2, low);
delay(100);
digitalwrite(2, high);
delay(100);
digitalwrite(2, low);
}
quote
i have wait until stepper finished steps before loop continues.why?
code: [select]
for(int i=0; i<numberofsteps; i++)
{
stepper.step(1);
}
in loop, other things, diddle led. of course, loop isn't right statement use, illustrates can run stepper same way walk across unfamiliar room in pitch dark - 1 small step @ time.
Arduino Forum > Topics > Robotics (Moderator: fabioc84) > Alternative to stepper Libary
arduino
Comments
Post a Comment