I'm very new with Arduino and Adafruit and I'm trying to get a DC motor running with my Adafruit Motor Shield V2.3, but it's not running. I have connected the motor to the right terminal (M3). I'm following the Adafruit website guide. Does anyone know what I'm doing wrong?
Here is the Arduino and Motor Shield:
And here is my code:
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_MS_PWMServoDriver.h"
Adafruit_MotorShield AFMS = Adafruit_MotorShield();
Adafruit_DCMotor *myMotor = AFMS.getMotor(3);
void setup()
{
AFMS.begin();
myMotor->setSpeed(255);
}
void loop()
{
myMotor->run(FORWARD);
delay(2000);
myMotor->run(BACKWARD);
delay(2000);
myMotor->run(FORWARD);
delay(2000);
myMotor->run(RELEASE);
delay(1000);
}
The code uploads with no errors but nothing happens after that.