Hello everyone,
I'm a newbie with Arduino and electronics, and I'm having problems simply by running the Stepper Test from Adafruit Motor Shield. Would appreciate your help.
I am powering via the UNO board through a 12V 5A adapter. I don't know if this is the first mistake and I should power direct through the shield, but I don't have the piece that diverges the adapter jack into the + and - cables.
I've tried with two motors and none of them work, a SM-42BYG011-25 which runs with 12V and 0.33A and a SY28STH45-0674A which is 4.5V and 0.67A
As additional info. I haven't soldered the headers connections between the UNO and the shield since I'm waiting for the stacking headers to install other shield above. But since the power is being transmitted (led light on) I think the headers are working OK.
The project at the end should drive 4 stepper motors (that's why I should stack another motor shield above) but achieving this test would be a good first step for me.
Thank you!
Juan
this is the code from Adafruit Stepper test library:
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_PWMServoDriver.h"
// Create the motor shield object with the default I2C address
Adafruit_MotorShield AFMS = Adafruit_MotorShield();
// Or, create it with a different I2C address (say for stacking)
// Adafruit_MotorShield AFMS = Adafruit_MotorShield(0x61);
// Connect a stepper motor with 200 steps per revolution (1.8 degree)
// to motor port #2 (M3 and M4)
Adafruit_StepperMotor *myMotor = AFMS.getStepper(200, 2);
void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println("Stepper test!");
AFMS.begin(); // create with the default frequency 1.6KHz
//AFMS.begin(1000); // OR with a different frequency, say 1KHz
myMotor->setSpeed(10); // 10 rpm
}
void loop() {
Serial.println("Single coil steps");
myMotor->step(100, FORWARD, SINGLE);
myMotor->step(100, BACKWARD, SINGLE);
Serial.println("Double coil steps");
myMotor->step(100, FORWARD, DOUBLE);
myMotor->step(100, BACKWARD, DOUBLE);
Serial.println("Interleave coil steps");
myMotor->step(100, FORWARD, INTERLEAVE);
myMotor->step(100, BACKWARD, INTERLEAVE);
Serial.println("Microstep steps");
myMotor->step(50, FORWARD, MICROSTEP);
myMotor->step(50, BACKWARD, MICROSTEP);
}