#include <Stepper.h> //library to control the motor

const int stepsPerRevolution = 2038; // the amount of steps needed to make a full rotation 
Stepper myStepper = Stepper(stepsPerRevolution, 7, 5, 6, 4); // initialize the motor with the pins that we connected

void setup() { //happens once
  myStepper.setSpeed(10); // set speed to 10 rpm, you can change to whatever speed you want
}

void loop() { //loops forever
	myStepper.step((random(1,6)/2.0)*(stepsPerRevolution)); 
  // picks a random number from 1-6 and divides it by 2.0 to allow for decimals. Then multiplies that number by 1 revolution and spins it.
  delay(100); // wait 0.1 seconds
  myStepper.step(-(random(1,10)/2.0)*(stepsPerRevolution)); // same thing but in reverse
  delay(100); // wait 0.1 seconds
}