I've connected my unipolar motor with just 4 wires to convert it on a bipolar stepper motor like this:
A+: Green
A-: Black
B+: Red
B-: Blue
I want to use example included in the Arduino (File -> Examples -> Stepper -> stepper_oneRevolution).
Questions are:
Wires motor connection on Motor Shield R3 are OK?
Which parameters are good for Stepper constructor in the example? I've search a lot on the internet, source code of Stepper but impossible to understand which pins must be affected (Stepper myStepper(200, p1,p2,p3,p4)
Hi, I found this on the forum and it works. You can play around with the number of steps and the revs.
hope it helps
// Include the Stepper Library #include <Stepper.h>
// Map our pins to constants to make things easier to keep track of
const int pwmA = 3;
const int pwmB = 11;
const int brakeA = 9;
const int brakeB = 8;
const int dirA = 12;
const int dirB = 13;
// The amount of steps for a full revolution of your motor.
// 360 / stepAngle
const int STEPS = 480;
// Initialize the Stepper class
Stepper myStepper(STEPS, dirA, dirB);
void setup() {
// Set the RPM of the motor
myStepper.setSpeed(20);