Stepper programming question

Hello everyone

thanks for taking the time t read and hopefully assist me
I am a Noob so please be patient, it would appear my logic is illogical

I am trying to use a TB6600 stepper driver to drive a stepper motor motor 200 pulses forward or reverse depending in inputs selected.

My problem is when I briefly enable an input the motor steps through the 200 pulses, pauses the moves again, up to 7 times (1400 pulses) then stops.

any assistance would be great

I have attached the script, hope some one can come to my rescue

TIA
Christos

Stepper.ino (2.77 KB)

Do you have pulldown resistors (10k) on the FWD & REV pins? Like S1.

No I dont, I will try that tomorrow, thanks for the tip

All fixed thanks