stepper motor stop command
hello ,
i'm using following code run stepper motor. motor works fine. however, want modify code, motor rotate specific distance , stop, rather rotate continuously in loop. really not have idea arduino coding. please me..thanks in advance!!
here's code i'm using
i'm using following code run stepper motor. motor works fine. however, want modify code, motor rotate specific distance , stop, rather rotate continuously in loop. really not have idea arduino coding. please me..thanks in advance!!
here's code i'm using
code: [select]
int distance = 0;
void setup() {
pinmode(8, output);
pinmode(9, output);
digitalwrite(8, low);
digitalwrite(9, low);
}
void loop() {
digitalwrite(9, high);
delaymicroseconds(200);
digitalwrite(9, low);
delaymicroseconds(200);
distance = distance + 1;
if (distance == 3600)
{
if (digitalread(8 ) == low)
{
digitalwrite(8, high);
}
else
{
digitalwrite(8, low);
}
distance = 0;
delay(500);
}
}
can read guidelines , edit post use code-tags - won't parts of
it scrambled emoticons.
it scrambled emoticons.
Arduino Forum > Using Arduino > Motors, Mechanics, and Power (Moderator: fabioc84) > stepper motor stop command
arduino
Comments
Post a Comment