Motor not rotating with this code,I use adafruit motor shield with arduino mega

Here’s my code,I’m using a simple DC motor, not getting any type of error during veryfing or uploading the code

#include <Wire.h>
#include <Adafruit_MotorShield.h>
Adafruit_MotorShield AFMS = Adafruit_MotorShield();
Adafruit_DCMotor *myMotor = AFMS.getMotor(2);

void setup() {
// put your setup code here, to run once:
AFMS.begin();
myMotor->setSpeed(250);
myMotor->run(FORWARD);
}

void loop() {

}

To post code and/or error messages:

  1. Use CTRL-T in the Arduino IDE to autoformat your complete code.
  2. Paste the complete autoformatted code between code tags (the </> button)
    so that we can easily see and deal with your code.
  3. Paste the complete error message between code tags (the </> button)
    so that we can easily see and deal with your messages.
  4. If you already posted without code tags, you may add the code tags by
    editing your post. Do not change your existing posts in any other way.
    You may make additional posts as needed.
  5. Please provide links to any libraries that are used
    (look for statements in your code that look like include ). Many libraries
    are named the same but have different contents.

Before posting again, you should read the three locked topics at the top of the Programming Questions forum, and any links to which these posts point.

And post a diagram of your wiring. Hand drawn is good enough.

If your project involves wiring, please provide a schematic and/or a wiring diagram and/or a clear photograph of the wiring.