static int step = 4;
static int dir = 2;
static int button =  6;
static int button2 = 7;
void setup() {
    
  Serial.begin(9600);
  pinMode(step, OUTPUT);
  pinMode(dir, OUTPUT);
  pinMode(button, INPUT);
  pinMode(button2, INPUT);
}

void loop() {
    int zasuk = 10;
  if (digitalRead(button) == 1) {

  digitalWrite(dir, LOW);
  for (int i = 0, i < zasuk; i**)

  korak();
  

  delay(500);
  }

  if (digitalRead(button2) == 1) {

    digitalWrite(dir, HIGH);
    for (int i = 0, i < zasuk; i**)

    korak();
    
   

    delay(500);

  }


}

  void korak() {
    digitalWrite(step, HIGH);
  delayMicroseconds(10);
  digitalWrite(step, LOW);
  delayMicroseconds(10);
  }
A4988