Need Help Controlling Bipolar.

dejavucurly:
I am using Arduino uno + arduino motor shield and i am using 4 wire bipolar from scanner. This code is the only code was working. i been searching many pages and try a lot of different codes but this one the only one working. Basically the 4 wire bipolar i am using like this AABB so that was the problem. Now this code is working but its working forever i like to do step by step like i should try to decide how many step i need and when is the step done stops and i will click the button and same thing will happen but reverse. If this possible?

The fact that the motor is, as you've called it "AABB", is not such an issue. It just means that you'd have to wire it slightly differently (I'm guessing pins 1,3,2,4 or something like that).

What you want to do is very possible, it's quite simple in fact. You'll want a counter variable that you increment on each loop, a check for a button press input on each loop, and when the press occurs you'll want to reset your counter. You'd also need a variable to indicate step direction that you would toggle on the button press, and the step sequence you'd send would have to differ based on the direction.

If the above sounds difficult to you then start with just a basic Arduino + some LEDs + a button, and experiment a bit. Also use the serial port and monitor in the Arduino IDE (i.e. in your code you can put a Serial.Println("Check A"), for example, and when that occurs it will appear in the serial monitor.