Stepper Motor ENA pin

Most tutorials or documentation about Stepper Motors do not use the ENA pin, to me if I would like to use it and I can not think of a way to do it, some help?

The code that I have only uses DIR and PUL, and the documentation of the library does not say anything about ENA.

#include <Stepper.h>

const int stepsPerRevolution = 200;  // change this to fit the number of steps per revolution
// for your motor

// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);

void setup() {
  // set the speed at 60 rpm:
  myStepper.setSpeed(60);
  // initialize the serial port:
  Serial.begin(9600);
}

void loop() {
  // step one revolution  in one direction:
  Serial.println("clockwise");
  myStepper.step(stepsPerRevolution);
  delay(500);

  // step one revolution in the other direction:
  Serial.println("counterclockwise");
  myStepper.step(-stepsPerRevolution);
  delay(500);
}

So what do you want to use it for? There is little point in using it if it is not suitable for your project.

1 Like

I want to use it to turn off the Stepper Motor when I are not using it. Because the one who uses will be portable (I will use a battery), so if it is always ignited, it will consume incessary energy.

As you know, a Stepper Motor on can not be moved by hand and is blocked, that is, it is maintained by consuming energy.

Yes so that if you can stand the motor having no torque then turn it off, what is the problem?

I want to turn it off from the code, with the ENA pin, as I said above, I only use the pin PULL and DIR, I also want to use ENA to turn it off.

Sorry but I don’t get what you are not understanding.
Connect the ENA pin to an Arduino pin, and set it high or low depending on if you want the motor to be enabled or disabled.

Check the data sheet of your driver to see what logic level activates the motor.

1 Like

A thousand thanks, it worked.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.