1

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 recently asked this question and was told I need a battery connected to the Adafruit too. I have now connected a battery but still no success.

Here is the Arduino and Motor Shield:

enter image description here

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.

spring
  • 18,009
  • 15
  • 80
  • 160
GoatZ
  • 31
  • 2
  • 1
    Can you link to the Adafruit motor library you are using? Do the function arguments do what you think they do? Are you getting a voltage across the motor terminal blocks? – Mepix Nov 24 '19 at 16:35
  • 2
    Perhaps some questions on the [robotics stack exchange](https://robotics.stackexchange.com/search?q=adafruit+motor) may help you since this is a fairly common board/motor setup. – Mepix Nov 24 '19 at 16:38

0 Answers0