Go Down

Topic: Stepper Object and setSpeed() function. (Read 458 times) previous topic - next topic

SuperveS

Mar 23, 2011, 12:45 pm Last Edit: Mar 23, 2011, 08:34 pm by SuperveS Reason: 1
Hi all,
I want to activate my stepper motor,
my question is which of the pins i entered in   "Stepper (stepNum,pin1,pin2,pin3,pin4)"
sends the steps signal?
i started with just two pins -  steps and direction.
i can see that the direction really changes every 5 sec. (as written in the code)
yet i dont get any signal on any other pin....

i wrote the follwing code to begin with:
#include <Stepper.h>

int stepPin = 13;
int directionPin = 11;
Stepper motor (200, stepPin, directionPin,8,9);


void setup()  {
Serial.begin(9600);
}

void loop()  
{
   digitalWrite(directionPin,HIGH);
   motor.setSpeed(50);
   delay(5000);
 
   digitalWrite(directionPin,LOW);
   motor.setSpeed(5);
   delay(5000);
}// loop ends

Go Up