Hello and thank you in advance for your help. I have a Arduino Duemilanove and an Adafruit motor shield. I am using a 4.5V to 9 V DC motor. My arduino is powered by USB or a 9V battery. The shield and motors are powered by 12 V (8 new AAA batteries in series or one large lead acid battery, I tried both) in the external power jack on the shield. The shield was built according to the instructions (though I could have soldered something incorrectly or messily). The LED lights. Servos work fine. When I upload and run this following code, which is an example in the AFmotor library, which I downloaded to use the shield, the motor barely spins or doesn't spin at all. The motors don't spin with any other code I have created or found online. It does not accelerate or decelerate over the entire acceleration and deceleration periods. I confirmed on an oscilloscope that the PWM on that motor channel was working. Replacing the motor driver chips has not worked. Has anyone else experienced this problem? What should I test/do?
Code:// Adafruit Motor shield library
// copyright Adafruit Industries LLC, 2009
// this code is public domain, enjoy!
#include <AFMotor.h>
AF_DCMotor motor(4);
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);
}