Arduino uno+motorshield R3+ unipolar stepper motor

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
seandelgatto2001
 
Posts: 1
Joined: Thu Apr 19, 2012 3:49 pm

Arduino uno+motorshield R3+ unipolar stepper motor

Post by seandelgatto2001 »

I tried using the arduino forum but it is buggy doesnt load well and can't get the information i need.

I wired a unipolar npr stepper motor as a bipolar : coil 1 - black A+ Green A- then coil 2 RED B+ and Blue B- then the two center taps for the coils as ground per instructions from this site.

The problem is there is not to much out there on using Arduino Motorshield R3 out there i can duplicate so I am wondering about what pins to reference in the sketch below. Someone told be not to use pin 1, so what pins should I be referencing for A+ A- B+ and B- ????


#include <Stepper.h> //include the function library
#define STEPS 200 //3.75 deg motor (96 steps per rev)
Stepper stepper(STEPS, 1, 2, 3, 4); //create the stepper

void setup()
{
int i;
stepper.setSpeed(30); //set speed to 30 rpm
delay(1000); //pause for effect
stepper.step(200); //move 360 deg one direction
delay(1000); //pause for effect
stepper.step(-200); //move 360 deg in the other direction
delay(1000); //pause
stepper.setSpeed(60); //speed up
for (i=0;i<5;i++) {
stepper.step(20); //wave the flag
stepper.step(-20);
}
}

void loop()
{}

I notice a small reaction in the stepper motor and only the LED for A+ side flickers the rest don't so I think that the program does not have the right pins on program line : Stepper stepper(STEPS, 1, 2, 3, 4)

[ http://arduino.cc/en/uploads/Main/ardui ... ematic.pdf ]

I looked at the diagram and it looks as though it states DIRA is off 9 and DIRB is off 15, towards the IC1 side

But then it gives a 1 and 2 off of IC2 A then 12 and 13 off IC2 D

Maybe im just really tired but Im thinking that on the programing side it should be Stepper stepper(STEPS, 1, 2, 12, 13)

Does that seam right or should it be Stepper stepper(STEPS, 9, 15)

If anyone can verify that would be much appreciated. I realize Im extremely new to this, and the book I got includes everything except running a stepper motor, servo and basically stuff I would be using a stepper for, so I ordered another one off amazon.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”