// Stepper motor on Wokwi!

#include <Stepper.h>

const int stepsPerRevolution = 200; 

Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);

int debounceTime = 100;

int OldTime1 = 0;
int OldState1 = HIGH;
int OldTime2 = 0;
int OldState2 = HIGH;
int OldTime3 = 0;
int OldState3 = HIGH;


void setup()
{
  myStepper.setSpeed(60);
  pinMode(3, INPUT_PULLUP);
  pinMode(4, INPUT_PULLUP);
  pinMode(5, INPUT_PULLUP);
}

void loop() 
{
  int time = millis();
  int state1 = digitalRead(3);
  int state2 = digitalRead(4);
  int state3 = digitalRead(5);
  if ( (time - OldTime1) > debounceTime)
  {
    if (state1 == LOW && state1 != OldState1)
    {
        myStepper.step(100);
        delay(1000);
        myStepper.step(-100);
    }
    OldState1 = state1;
    OldTime1 = time;
  }
  if ( (time - OldTime2) > debounceTime)
  {
    if (state2 == LOW && state2 != OldState2)
    {
        myStepper.step(-100);
        delay(1000);
        myStepper.step(100);
    }
    OldState2 = state2;
    OldTime2 = time;
  }
  if ( (time - OldTime3) > debounceTime)
  {
    if (state3 == LOW && state3 != OldState3)
    {
        myStepper.step(100);
        delay(1000);
        myStepper.step(-100);
    }
    OldState3 = state3;
    OldTime3 = time;
  }
}
$abcdeabcde151015202530fghijfghij