#include "FastAccelStepper.h"

#define STEP_PIN 5
#define DIR_PIN 4

int speed = 1;

void setup() {
  Serial.begin(115200);



}

void loop() {
  Serial.print(speed);

  Serial.println(cnt);

  speed *= 2;
  if (abs(speed) > 20000) {
    speed = (speed < 0) - (speed > 0);
  }

  delay(1000);
}
A4988