Hi …
I am working on my first robot project with a little experience in Arduino or electronics.
In my project, i need to control 3 dc motors " hoppy or cheap dc motor " … so, I choice motor shield v1 from DK Electronic to controlling the 3 dc motors and power the motor shield by WP4.5-6 6V 4.5 Ah battery.
In the first place, the motors work perfectly, but an after a day I tried to operate the motor, but it does not spin with producing small sound !!
I tried to operate just one dc motor and the same problem occurred.
So, I read so many forums, and I didn’t reach to a solution.
the code I used …
// you need this so you can use the adafruit motor shield library:
#include <AFMotor.h>
// this created our motors "name" on port 1,2,3,4 of the motorshield:
AF_DCMotor motor(1, MOTOR12_64KHZ);
AF_DCMotor motor2(2, MOTOR12_64KHZ);
AF_DCMotor motor3(3, MOTOR12_64KHZ);
void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println("Motor test!");
// set the speed to 0 to 255 of "motor". Note that 0 is stop,
// 255 is full speed:
motor.setSpeed(100);
motor2.setSpeed(100);
motor3.setSpeed(100);
}
void loop() {
Serial.print("tick");
motor.run(FORWARD); // turn it on going forward
motor2.run(FORWARD); // motor 2 goes forward as well
motor3.run(FORWARD);
delay(1000);
Serial.print("tock");
motor.run(BACKWARD); // the other way
motor2.run(BACKWARD); //again for motor 2
motor3.run(BACKWARD);
delay(1000);
Serial.print("tack");
motor.run(RELEASE); // stopped
motor2.run(RELEASE); // command motor 2 to stop
motor3.run(RELEASE);
delay(1000);
}