Every 60 seconds insert a random number

I'm driving a stepper motor using an adafruit motor shield. I have it set up so that it rotates 6 rev per minute. I'd like to be able to add that every 60 s the revolution randomly change from 5 to 7 revolution per minute. I can figure out what the delay will be by trail and error, delay now is 1084.

int stepCount;
unsigned long previousMillis;

#include <Wire.h>
#include <Adafruit_MotorShield.h>

// Create the motor shield object with the default I2C address
Adafruit_MotorShield AFMS = Adafruit_MotorShield(); 

Adafruit_StepperMotor *myMotor = AFMS.getStepper(2052, 1);


void setup() {
  Serial.begin(9600);           // set up Serial library at 9600 bps
  Serial.println("Stepper test!");

  AFMS.begin();  // create with the default frequency 1.6KHz
 
  myMotor->setSpeed(1000);  // 10 rpm   
}

void loop() {
  unsigned long currentMillis = millis();
  //Serial.println("Single coil steps");
  myMotor->onestep(FORWARD, SINGLE);
  delayMicroseconds(1084);
  stepCount++;
  if(stepCount == 2052)
  {
    unsigned long lapTime = currentMillis - previousMillis;
    Serial.println(lapTime);
    previousMillis = currentMillis;
    stepCount = 0;
  }
}

I can figure out what the delay will be by trail and error, delay now is 1084.

The delay is now hard-coded to be 1084. First thing you need to do is change that so that the delay time is stored in a variable.

The second thing you need to do is determine if it is time to change the value. The "requirement" you stated is too vague for me to figure out.

The third thing you need to do is determine what the new speed will be. random() and randomSeed() are well documented.

The rest is trivial.