Problem with nema 17 stepper and grbl library

Robin2:
The erratic behaviour in your videos could be caused by the Arduino resetting.

Post you wiring diagram.

...R

I'm trying if the stepper work with this wiring diagram: http://howtomechatronics.com/wp-content/uploads/2015/08/A4988-Wiring-Diagram.png?x57244

obviously the it's not connecter to pin 3 and 4 as the link say but to the pin 7 and 8 (as the code say)

Please make a drawing showing YOUR connections and post a photo of the drawing. Often the business of making the drawing helps to identify problems.

...R