I have moved your Topic to Project Guidance....Please try not to post in Uncategorised again, If you are unsure about the categories refer to this guide or to the stickies for each category.
I try to actuate by other Code.
it was not works in specific delaymicroseconds( for modifing 1 pulse time)
So i think it is physics motor's problem, is'n it?
// it wasn't work in next code(vibration)
for (int i = 0; i < stepsPerRevolution; i++) {
digitalWrite(stepPin, HIGH);
delayMicroseconds(2000);
digitalWrite(stepPin, LOW);
delayMicroseconds(2000);
}
delay(1000);
digitalWrite(dirPin, LOW);
for (int i = 0; i < stepsPerRevolution; i++) {
digitalWrite(stepPin, HIGH);
delayMicroseconds(1000);
digitalWrite(stepPin, LOW);
delayMicroseconds(1000);
}
delay(1000);
// it works on next code
digitalWrite(dirPin, HIGH);
for (int i = 0; i < 5 * stepsPerRevolution; i++) {
I think you might be driving the motor too fast initially. You seem to be sending pulses at 500Hz in bursts of 5*steps/rev to the motor and it has no time to accelerate. To check your code logic and hardware send much slower pulses initially, say at 10Hz, and check it moves OK. If you really need to run the motor very fast you will need to accelerate and decelerate it at the end of each move. There are libraries which can do that.