Hello,
I have bought a motor shield by Adafruit. I am trying to follow this guide (Install Software | Adafruit Motor Shield V2 | Adafruit Learning System) but unfortunately, my motor is not working. I am not sure what I am doing wrong.
-
I have set up the following as you can see in the image. I am powering only the shield from 11.1V LiPo battery. Arduino is hopefully powered from the shield. I am not sure if I need to remove the Jumper in the shield but until now I haven' t done it. The orange and yellow wire is going directly to my DC motor the other two wires near the orange are my second DC motor.
-
I have downloaded the library (which i think is the same as the v1 motor shield???) and I have uploaded the motor test sketch. This is the following:
// 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);
}
Any idea why this is not working? Do I need to supply some more information about something? I am using Arduino Mega!
Oh i forgot! WHY MY ONBOARD LED IS NOT GREEN? All over the Internet i see green leds...
thanks guys...