Motor Shield V 2.0 - Not Functioning with DC Motors

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
jonsberndt
 
Posts: 4
Joined: Sun Sep 21, 2014 11:49 pm

Re: Motor Shield V 2.0 - Not Functioning with DC Motors

Post by jonsberndt »

adafruit_support_bill wrote:Jon - Please post photos of the board showing all of your soldering and motor connections.
The attachment soldering.JPG is no longer available
The motor connections and lights on.
The motor connections and lights on.
soldering.JPG (552.77 KiB) Viewed 147 times
Lights on the Arduino UNO.
Lights on the Arduino UNO.
MotorLights.JPG (911.02 KiB) Viewed 147 times
Sorry for the poor quality of the photos. If needed, I can upload some super hi-res ones later.

I uploaded and used the MotorTest code, but with the motor call changed from 4 to 1.

Code: Select all

// Adafruit Motor shield library
// copyright Adafruit Industries LLC, 2009
// this code is public domain, enjoy!

#include <AFMotor.h>

AF_DCMotor motor(1);

void setup() {
  Serial.begin(9600);           // set up Serial library at 9600 bps
  Serial.println("Motor test!");

  // turn on motor
  motor.setSpeed(200);
 
  motor.run(RELEASE);
}

void loop() {
  uint8_t i;
  
  Serial.print("tick");
  
  motor.run(FORWARD);
  for (i=0; i<255; i++) {
    motor.setSpeed(i);  
    delay(10);
 }
 
  for (i=255; i!=0; i--) {
    motor.setSpeed(i);  
    delay(10);
 }
  
  Serial.print("tock");

  motor.run(BACKWARD);
  for (i=0; i<255; i++) {
    motor.setSpeed(i);  
    delay(10);
 }
 
  for (i=255; i!=0; i--) {
    motor.setSpeed(i);  
    delay(10);
 }
  

  Serial.print("tech");
  motor.run(RELEASE);
  delay(1000);
}
Last edited by adafruit_support_bill on Mon Sep 22, 2014 12:13 pm, edited 1 time in total.
Reason: Please use the '</>' button when posting code. Paste your code between the [code] tags.

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Motor Shield V 2.0 - Not Functioning with DC Motors

Post by adafruit_support_bill »

Code: Select all

#include <AFMotor.h>
You are using the library for the V1 shield. The V2 shield requires the V2 library.
https://github.com/adafruit/Adafruit_Mo ... V2_Library

User avatar
jonsberndt
 
Posts: 4
Joined: Sun Sep 21, 2014 11:49 pm

Re: Motor Shield V 2.0 - Not Functioning with DC Motors

Post by jonsberndt »

That made the difference. Thanks. All works, now.

Jon

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”