Go Down

Topic: Stepper motor project. (Read 2132 times) previous topic - next topic

larswik

Hello, first time posting. I have the Arduino Duemil board and a the easy stepper driver board from Sparkfun. I also bought their bi polar stepper motor. I have been learning C for the last 4 months on my Mac and I am getting some what good at it. Can someone direct me to some test code that I can use (if it exists) to test out the motor. I have never worked with hardware before so I am a little unsure as to what I must do. I was following this example and tried his code but it did not seem to work right. http://garagedeveloper.wordpress.com/2009/12/05/the-diy-surveillance-system-using-a-webcam-part-1/

Any help or links would be greatly appreciated as I start to learn.

-Lars

fliggygeek

http://www.arduino.cc/en/Tutorial/StepperBipolar

There is some test code here that might work, a little info on your pinout/schematic would also be helpful so i can do more.


larswik

Thanks you for those links. I will take a look at them. I am hoping one of them comes with a list of the functions available. like I see digitalWrite and ledPin.

Thanks again!

-Lars

larswik

So I got everything connected and used the software that I found on the web to test it and the stepper motor won't turn. I put a voltage meter to all my connections and the stp and dir both showed voltage. The 4 stepper outputs on the easy driver (A and B) all register 0 so it appears that nothing is going to the stepper motor.

Any ideas?

Code: [Select]
/********************************************************
**         More info about the project at:             **
**  http://lusorobotica.com/viewtopic.php?t=103&f=106  **
**   by TigPT         at         [url=http://www.LusoRobotica.com]www.LusoRobotica.com[/url]  **
*********************************************************/
int dirPin = 2;
int stepperPin = 3;

void setup() {
  pinMode(dirPin, OUTPUT);
  pinMode(stepperPin, OUTPUT);
}

void step(boolean dir,int steps){
  digitalWrite(dirPin,dir);
  delay(50);
  for(int i=0;i<steps;i++){
    digitalWrite(stepperPin, HIGH);
    delayMicroseconds(100);
    digitalWrite(stepperPin, LOW);
    delayMicroseconds(100);
  }
}

void loop(){
  step(true,1600);
  delay(500);
  step(false,1600*5);
  delay(500);
}

mmcp42

you're stepping far too fast
change delayMicroseconds(100)
to delay(100)
there are only 10 types of people
them that understands binary
and them that doesn't

Go Up