NEMA17 A4988 serial monitor

Hi,
I'm trying to run my nema17 stepper motor with A4988 driver using arduino and serial monitor.
Unfortunately, the motor does not react to any commands. I wrote simple code just to test it, it powers up but nothing happens. It doesn't move. Can someone guide me how to improve my code so it would run and I would be able to control motor with serial monitor? Best regards.

#define DIRPIN D4
#define STEPPIN D3
// Wait time between 400 - 1000
int WaitTime = 400;
const int LEFT = LOW;
const int RIGHT = HIGH;
int informator = 0;

void runner() {
      digitalWrite(STEPPIN,HIGH); 
      delayMicroseconds(WaitTime); 
      digitalWrite(STEPPIN,LOW); 
      delayMicroseconds(WaitTime);
}

void stopper() {
      digitalWrite(STEPPIN,LOW); 
      delayMicroseconds(WaitTime); 
      digitalWrite(STEPPIN,LOW); 
      delayMicroseconds(WaitTime);
}

void setup() {
  Serial.begin(9600);
  pinMode(STEPPIN,OUTPUT); 
  pinMode(DIRPIN,OUTPUT);
  // init motor
  digitalWrite(DIRPIN,RIGHT); 
//  digitalWrite(STEPPIN,LOW); 
  delayMicroseconds(WaitTime);   
  Serial.begin(115200);
}

void loop() {
if (Serial.available() > 0) 
  {
    informator = Serial.read();
    {
      if (informator == 'R')
      {
        runner();
      } 
      
      if (informator == 'S')
      {
        stopper();
      }
    }
  }
}

Search for "Bssic stepper....".
There are things You need to learn about steppers.
Try sending some 1000 "R"!

tomjech:
Can someone guide me how to improve my code so it would run and I would be able to control motor with serial monitor?

I suspect you are trying to make the motor move too fast. Always start with a very slow speed - perhaps 2 or 5 steps per second.

Also, think of your problem as two parts - making the motor move and getting data from the Serial Monitor.

If you need more help please post a link to the datasheet for your stepper motor - there are hundreds of different Nema 17 motors. AND tell us what stepper motor power supply you are using (volts and amps).

...R
Stepper Motor Basics
Simple Stepper Code

The main loop is only sending a single step when you enter "R".
Change to something like:

void loop() {
  if (Serial.available() > 0)
  {
    informator = Serial.read();
  }

  if (informator == 'R')
  {
    runner();
  }
}