Operating a simple dc motor with a r3 motor shield

i have a 15 rpm motor and a rc car esc what would be simple code to run the motor from point a to point b then stop for 30 seconds then repeat or is there a thread i can pointed to

#include <Servo.h> 
 
Servo TheESC;  // create servo object to control the Electronic Speed Control 
 
void setup() 
{ 
  TheESC.attach(9);  // attaches the ESC on pin 9 to the servo object 
} 
 
void loop() 
{ 
  TheESC.write(180);  // Run the motor at full speed
  delay(2000);           // Wait two seconds (the time it takes to get from 'a' to 'b')
  TheESC.write(0);    // Stop the motor
  delay(30000);         // Wait thirty seconds before repeating
}

ok thanks but i instead got a r3 motor shield and this is what i have so far

// i want the motor to do a full rotation then stop by the means of a rocker switch 
// and do this repeated every 25 sec
// i also need a momentary button to override the program and just do one rotation of the motor


void setup() {
  
  
  pinMode(12, OUTPUT); //Initiates Motor Channel A pin
  pinMode(9, OUTPUT); //Initiates Brake Channel A pin
  
}

void loop(){
  
 digitalWrite(12, HIGH); //Establishes forward direction of motor
  digitalWrite(9, LOW);   //Disengage the Brake for motor
  analogWrite(3, 255);   //Spins the motor on motor at full speed
  
  delay(7550);
  
  digitalWrite(9, HIGH); //Eengage the Brake for motor

  delay(500);
  
  
    
  }
}

You call this a 15RPM motor. I assume it is really a higher RPM motor, with a gear box to reduce the output to 15RPM. Is that correct.
I don't think you want to use servo library.
What is the voltage of the motor? Got a URL?
And a URL to that motor shield would be great also.

Have you given it a try? What does it do, or don't do ?
If you have not yet given it a try, maybe use the blink code to see if you can get it to just run.

Let us know.

as of now i can just make it rotate at speed and yes its a gearbox motor that is from servo city .com