Use keyboard to switch action

Hi there, I was trying to run a programme that will run a stepper motor continuously when button 1 is pressed and it will stop when button 2 is pressed. Can anyone help me on this please ? Thanks !

sketch_jun21a.ino (2.06 KB)

try this

sketch_jun21a.ino (1.92 KB)

What type of stepper motor are you trying to control?
BTW that code doesn't look like it would operate any stepper motor. I have found sometime just switching (reversing)two or more phases continuously will make some movements

Hi buddy, thanks for replying .The file u send does not work as what I want. It only move once when 1 is pressed.