Hey, at My school we got a bunch of these sheilds, and for some reason THE m2 does not work
No One knows why. We tried more voltage voltage and stuff.
Anyone got a clue ? We now use only m3 and m4 for THE all THE 4 motors.
Cheers
Dear,
Try these code to get motor 2 (M2) work.
Also pay attention for applying motor voltage (ext power).
Motor voltage are from: 4,5V to max. 16V DC.
If this not work check the motors and connection.
Or change IC1 (L293D) this driver controls motor 1 & 2. This chip can be defective as well during experiments.
Regards
Velleman support
Code:
// Adafruit Motor shield library
// copyright Adafruit Industries LLC, 2009
// this code is public domain, enjoy!
#include <AFMotor.h>
AF_DCMotor motor(2);
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);
}