That snippet of code is not near enough to solve your problem. The first thing that comes to my mind is that you have incorrectly defined the number of steps per revolution. Without being able to see how you have defined it, though, and without knowing anything about your motor, it’s only a guess.
Post ALL of your code, and a link to your motor (NOT an e-bay ad), if you want more than sympathy. Which you can’t get here, anyway.
Thanks for the reply! Here is all my code:
Here are the components I used with the above codes: (no ads here…)
1.Arduino Uno R3
3. Big Easy Driver (BED): https://www.sparkfun.com/products/10735
And I used full step mode (MS1, MS2, MS3 on BED connect to GND), I expected to have one revolution,
but the above codes only gave me 1/4 of a revolution, also the estimated speed is 1/4 of the expected value (30rpm);
Any advice on that? Thanks a lot!