What I want is that the stepper motor to be disabled. Then press the button and release it spins the engine one turn.
You need to detect when the switch transitions from released to pressed, and from pressed to released. This requires, of course. keeping track of the previous state of the switch.
int prevState = LOW;
int currState;
void loop()
{
currState = digitalRead(somePin);
if(currState != prevState)
{
// A transition occurred
}
prevState = currState;
}
Where the transition occurs, the current state tells you whether the transition was from released to pressed or from pressed to released. You can then step when the switch is pressed or when it is released. Your choice.